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);

    KERNEL: Hello world!

    Instead of the expected:
    Hello world!

    Brian Davis, Jan 1, 2014
    1. Advertisements

  2. Brian Davis

    HT-Lab Guest

    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,
    HT-Lab, Jan 2, 2014
    1. Advertisements

  3. Brian Davis

    Brian Davis Guest

    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!
    Yes, I've been using an s/^KERNEL:// preprocessing filter as a workaround.

    But it seems rather silly to need this...
    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:


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

    Hello world!

    Brian Davis, Jan 18, 2014
  4. Brian Davis

    Brian Davis Guest

    A correction to my earlier post:
    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 Davis, Jan 19, 2014
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.