As the RTL code for the itch decoder is simple but repetitive.
We generate it using and xml
file outlining the itch message format and a small script
itch_msg_to_rtl.py
.
To run script :
python itch_msg_to_rtl.py nasdaq_totalview_itch.xml
Note : python
is assumed to be python3
, tested with python version :
Python 3.11.3 (main, Apr 5 2023, 15:52:25) [GCC 12.2.1 20230201] on linux
.
This program generates 5 files, these files will be produced in the directory where the script is run.
-
port_list.v
top level itch interface ports. -
assign_logic.v
assign logic for driving decoder. -
formal.v
formal assertions. -
tb_port_list.v
port list for using the itch module in the test bench. -
tb_sig_list.v
declaration of the signals to be connected to itch module for use in the test bench.
Generation results can be altered by modifying the following situated at the top of the script :
-
SIG_PREFIX
signal name prefix, defaultitch_
-
SVA_PREFIX
system verilog formal assertion name prefix, defaultsva_
-
PORT_LIST_FILE
output file name for the generated port list, defaultport_list.v
-
ASSIGN_LOGIC_FILE
output file name for the assignation logic, defaultassign_logic.v
-
FORMAL_FILE
output file name for the formal assertions, defaultformal.v
-
TB_PORT_LIST_FILE
output file name for the itch module's ports, used when creating an instance of the itch module it the test bench, defaulttb_port_list.v
-
TB_SIG_LIST_FILE
output file name for the declarations of the signals connected to an instance of our itch module when used in the test bench, defaulttb_sig_list.v
-
MOLD_MSG_CNT_SIG
name for the net that stores the count of mold message payloads we have already received, defaultdata_cnt_q
-
MOLD_MSG_LEN
number of bytes each payload contains, default8
-
MOLD_MSG_DATA_SIG
name of the net on which the payload data is stored, defaultdata_q
-
ITCH_MSG_TYPE_SIG
name of the net on which the itch message type data is stored, defaultitch_msg_type
Originally found in https://github.com/doctorbigtime/itch, all credits belong to doctorbigtime
.
Was modified to remove all none itch messages under Structs
, diffs can be viewed in xml_diff.patch
.