Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

Controlling the message logger

  1. In this tip I explain how to control the message logger on two issues: padding the time print and mark the start and end of the message.
  2. Why is time-padding required? When you gerp some messages from the log file, you, in most cases, would like to see it indented. If the time is not padded, the assorted fields in the message keep going left.
  3. Why is message-marking so important? Because sometimes specman splits a message in the middle. This may happen when the message is too long. In that case marking the start and end of the message will facilitate the job for a post processing script.
  4. The specman code follows:

    1. //from the test do
    2. extend sys {
    3.   -- message control
    4.   keep logger.verbosity == FULL;
    5. };
    6. //Note you can also set verbosity from within the command line or from a TCL script:
    7. //sn set message -logger=sys.logger -verbosity=HIGH

    8. extend message_logger {
    9.   get_time(): string is also {
    10.     --var res := result ~ "/ ([a-z]s)/";
    11.     --if(res) then {
    12.     --result=appendf("%08d %s", sys.time, $1);
    13.     --};
    14.     var res := result ~ "/([0-9]*) ([a-z]s)/";
    15.     var tim : string = str_pad($1, 8);
    16.     var unt : string = $2;
    17.     result=appendf("%s %s", tim, unt);
    18.   };
    19.   format_message(): list of string is first {
    20.     result=get_message();
    21.     var p_time : string = appendf("dbgA %s dbgB", result[0]);
    22.     result[0]=p_time;
    23.   };
    24. };

  ...


Home

FIFO

CRC

Download Area

SD slave with Samsung flash (k9f1208) (vhdl project).






Search This Site


Feedback This Site




new pages on this site