Active-HDL: all writes to STDOUT are prefixed with "KERNEL:"

Discussion in 'VHDL' started by Brian Davis, Jan 1, 2014.

  1. Brian Davis

    Brian Davis Guest

    Does anyone know how to turn off the "KERNEL:" prefixing that occurs in Active-HDL ( using 9.2 Lattice Edition ) when one writes to STDOUT ?

    The closest thing I've found in the documentation is 'printdisplaytasksource', which just makes the prefixed message even more verbose.

    I have an existing testbench which writes log messages to STDOUT for later parsing; having this extra "KERNEL:" string prefixed to every write breaks the parser.

    i.e., the following VHDL:

    write (l, String'("Hello world!"));
    writeline (output, l);

    Produces:
    KERNEL: Hello world!

    Instead of the expected:
    Hello world!

    -Brian
    Brian Davis, Jan 1, 2014
    #1
    1. Advertising

  2. Brian Davis

    HT-Lab Guest

    On 01/01/2014 17:18, Brian Davis wrote:
    > Does anyone know how to turn off the "KERNEL:" prefixing that occurs in Active-HDL ( using 9.2 Lattice Edition ) when one writes to STDOUT ?
    >
    > The closest thing I've found in the documentation is 'printdisplaytasksource', which just makes the prefixed message even more verbose.
    >
    > I have an existing testbench which writes log messages to STDOUT for later parsing; having this extra "KERNEL:" string prefixed to every write breaks the parser.
    >
    > i.e., the following VHDL:
    >
    > write (l, String'("Hello world!"));
    > writeline (output, l);
    >
    > Produces:
    > KERNEL: Hello world!
    >
    > Instead of the expected:
    > Hello world!
    >
    > -Brian
    >


    I suspect there must be something as it is quite a basic requirement
    (lots of testbenches write log files which are filtered/analysed later on).

    On Modelsim you can find the option on the main transcript menu (or use
    set PrefMain(LinePrefix) {# } in your script) which shows you how
    popular it is.

    If there is no option in Aldec then I guess you have to resort to a bit
    of good old text filtering.

    Good luck,
    Hans
    www.ht-lab.com
    HT-Lab, Jan 2, 2014
    #2
    1. Advertising

  3. Brian Davis

    Brian Davis Guest

    Hans wrote:
    >
    > On Modelsim you can find the option on the main
    > transcript menu (or use set PrefMain(LinePrefix) {# }
    >

    There is a similar control in Active-HDL, $messageprefix (default = #)
    But that controls an additional prefix that shows up only in the GUI console transcript window:

    # KERNEL: Hello world!

    >
    > If there is no option in Aldec then I guess you have
    > to resort to a bit of good old text filtering.
    >

    Yes, I've been using an s/^KERNEL:// preprocessing filter as a workaround.

    But it seems rather silly to need this...

    >
    > I suspect there must be something as it is quite a basic
    > requirement (lots of testbenches write log files which
    > are filtered/analysed later on).
    >

    I have not been able to find a vsim command line option to disable this.

    However, I did finally find a way to turn it off from the GUI:

    Turning off Active-HDL message prefix (affects both GUI and command line):
    - fire up the Active-HDL GUI
    - Tools=>Preferences=>Environment=>Console=>uncheck "Show Message Prefix"

    Turning off additional GUI message prefix:
    $set messageprefix ""

    ----------------------
    Other notes:

    I'm trying to implement a simulator-agnostic testsuite which parses the output logs from a bunch of simulator runs.

    Ideally, I would like to turn off this prefix from the command line script that runs the testsuite, without needing user intervention in the GUI.

    So far Aldec is the only simulator I've found that corrupts writes to STDOUT.

    Also of note, Aldec writes both simulator and program messages both to STDOUT. Other simulators I've checked write their various messages to STDERR, while the VHDL write_line()s go to STDOUT; this lets you redirect the two independently.

    Writes to a file are un-corrupted, but I would need to some add file plumbing to my testbench & design.

    Somewhat amusingly, opening a (Windows) file named CON: allows writes to STDOUT without the prefix:

    file_open(log_file,"CON:",WRITE_MODE);

    write (l, String'("Hello world!"));
    writeline (log_file, l);

    Produces:
    Hello world!

    -Brian
    Brian Davis, Jan 18, 2014
    #3
  4. Brian Davis

    Brian Davis Guest

    A correction to my earlier post:
    >
    >However, I did finally find a way to turn it off from the GUI:
    >
    >Turning off Active-HDL message prefix (affects both GUI and command line):
    > - fire up the Active-HDL GUI
    > - Tools=>Preferences=>Environment=>Console=>uncheck "Show Message Prefix"
    >

    It turns out that "Show Message Prefix" option works only in the GUI, and does not affect the command line vsim simulator. (When I tested earlier, I must have mistakenly run the test code that was patched for file IO to STDOUT)

    I'll stick with the filter workaround for now, and see whether I can open an Aldec support account (when using a free Lattice license) to ask Aldec about this.

    -Brian
    Brian Davis, Jan 19, 2014
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yogesh
    Replies:
    3
    Views:
    574
    Kenny McCormack
    Feb 12, 2006
  2. Chris Withers
    Replies:
    1
    Views:
    426
    Lie Ryan
    Dec 18, 2009
  3. Replies:
    3
    Views:
    157
  4. Andreas S
    Replies:
    3
    Views:
    243
    Eric Hodel
    Dec 9, 2006
  5. Speeding up writes to STDOUT

    , Jun 5, 2006, in forum: Perl Misc
    Replies:
    7
    Views:
    122
    Ilya Zakharevich
    Jun 6, 2006
Loading...

Share This Page