2

In cocotb testbench log printing in terminal have really long line :

28204007.00ns INFO     cocotb.regression                         regression.py:341  in _log_test_summary               **************************************************************************************************************
                                                                                                                       ** TEST                                                  PASS/FAIL  SIM TIME(NS)  REAL TIME(S)  RATIO(NS/S) **
                                                                                                                       **************************************************************************************************************

This is too long for most xterminals. Is there options to reduce lines length ? Maybe we can hide some information like message line number or function name ?

FabienM
  • 3,421
  • 23
  • 45
  • Yes, Cocotb uses long lines, but it's required for the usecase. Otherwise you get hundreds of crippled and unreadable lines. I don't see any reason why people are still enforcing 80 character terminal windows on a 24 inch, 16:9, full HD (or bigger) monitor ... – Paebbels Jun 19 '17 at 07:49
  • There are lots of reasons why people are still enforcing ~80 characters terminal windows: You can split your screen to see two files side-by-side on the same screen, your brain will follow line correctly (if lines are too long brain lost line at return https://en.wikipedia.org/wiki/Line_length), ... Then yes long lines are a problem – FabienM Jun 19 '17 at 08:16

1 Answers1

1

Ok found it. Thanks to leftink there is an os environment variable to define to have reduced lines log length : COCOTB_REDUCED_LOG_FMT

To have reduced log length we can simply export variable in our terminal :

$ export COCOTB_REDUCED_LOG_FMT=1

If we want to have it by default, we can add it to our makefile :

    export COCOTB_REDUCED_LOG_FMT=1
    SIM=ghdl
    TOPLEVEL=mydesign
    VHDL_SOURCES =$(PWD)/../..
    [...]

This will give us a reduced lines length log :

28204007.00ns INFO     **************************************************************************************************************
                       ** TEST                                                  PASS/FAIL  SIM TIME(NS)  REAL TIME(S)  RATIO(NS/S) **
                       **************************************************************************************************************

Matching with standard terminals.

FabienM
  • 3,421
  • 23
  • 45