Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions TrackletGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def populate_bitwidths(mem,hls_dir): # FIXME this information should be parsed f
if barrelPS>-1 or barrel2S>-1: mem.bitwidth = 52
if disk>-1: mem.bitwidth = 55
elif mem.mtype == "TrackWord":
mem.bitwidth = 104
mem.bitwidth = 113
elif mem.mtype == "BarrelStubWord":
mem.bitwidth = 46
elif mem.mtype == "DiskStubWord":
Expand Down Expand Up @@ -497,16 +497,8 @@ def split_track_fit_streams(p_dict, m_dict):
down_p.upstreams.append(new_mem)
down_p.input_port_names.append("trackwordin")

# Determine the layers/disks from the associated full match
# memories.
layers = set()
if up_p is not None:
for up_m in up_p.upstreams:
if up_m.mtype != "FullMatch":
continue
layer = up_m.inst.split("_")[-1][0:2]
assert(layer.startswith("L") or layer.startswith("D"))
layers.add(layer)
# We will have all layers for each TrackWord
layers = {'L1', 'L2', 'L3', 'L4', 'L5', 'L6', 'D1', 'D2', 'D3', 'D4', 'D5'}

# Replace the old memory with a stub word for each of the
# layers/disks that can have matches.
Expand Down
168 changes: 92 additions & 76 deletions WriteVHDLSyntax.py

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions bodge/TF_D1D2_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_D3D4_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_L1D1_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_L1L2_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_L2D1_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_L2L3_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_L3L4_tb_writer.vhd.bodge

This file was deleted.

15 changes: 0 additions & 15 deletions bodge/TF_L5L6_tb_writer.vhd.bodge

This file was deleted.

6 changes: 0 additions & 6 deletions bodge/TF_tb_constants.vhd.bodge

This file was deleted.

41 changes: 29 additions & 12 deletions generator_hdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,36 @@ def writeTBMemoryWrites(memDict, memInfoDict, notfinal_procs,split, MPARdict):

if memInfo.isFIFO:
string_tmp = writeTBMemoryWriteFIFOInstance(mtypeB, memDict, proc)
# A bodge for TrackBuilder to write TF concatenated track+stub data.
# Code for TrackBuilder to write TF concatenated track+stub data.
# (Needed to compare with emData/).
if mtypeB == 'TW_104':
if mtypeB.startswith('TW_'):
for m in memDict[mtypeB]:
memName = m.inst
seed = memName[-4:]
fileTF = open("bodge/TF_" + seed + "_tb_writer.vhd.bodge")
string_tmp += fileTF.read();
fileTF.close()

bw_keys = [key for key in memDict if key.startswith('BW_')]
bw_width = memDict[bw_keys[0]][0].bitwidth if len(bw_keys) > 0 else 0
n_bw = len([key for key in memDict[bw_keys[0]] if seed in key.inst]) if len(bw_keys) > 0 else 0
dw_keys = [key for key in memDict if key.startswith('DW_')]
dw_width = memDict[dw_keys[0]][0].bitwidth if len(dw_keys) > 0 else 0
n_dw = len([key for key in memDict[dw_keys[0]] if seed in key.inst]) if len(dw_keys) > 0 else 0
# Calculate total width of track word plus stub words
total_width = str(m.bitwidth + n_bw * bw_width + n_dw * dw_width)

string_tmp += "-- Code for TrackBuilder to write TF concatenated track+stub data.\n";
string_tmp += "-- (Needed to compare with emData/).\n";
string_tmp += "writeTF_"+seed+"_" + total_width + " : entity work.FileWriterFIFO\n";
string_tmp += "generic map (\n";
string_tmp += " FILE_NAME => FILE_OUT_TF&\""+seed+"\"&outputFileNameEnding,\n";
string_tmp += " FIFO_WIDTH => " + total_width + "\n";
string_tmp += ")\n";
string_tmp += "port map (\n";
string_tmp += " CLK => CLK,\n"
string_tmp += " DONE => TB_DONE,\n";
string_tmp += " WRITE_EN => (TW_"+seed+"_stream_A_write and TW_"+seed+"_stream_AV_din("+str(m.bitwidth-1)+")),\n";
string_tmp += " FULL_NEG => TW_"+seed+"_stream_A_full_neg,\n";
string_tmp += " DATA => TW_"+seed+"_stream_AV_din&BW_"+seed+"_L1_stream_AV_din&BW_"+seed+"_L2_stream_AV_din&BW_"+seed+"_L3_stream_AV_din&BW_"+seed+"_L4_stream_AV_din&BW_"+seed+"_L5_stream_AV_din&BW_"+seed+"_L6_stream_AV_din&DW_"+seed+"_D1_stream_AV_din&DW_"+seed+"_D2_stream_AV_din&DW_"+seed+"_D3_stream_AV_din&DW_"+seed+"_D4_stream_AV_din&DW_"+seed+"_D5_stream_AV_din\n";
string_tmp += ");\n";

if memInfo.is_final:
if memInfo.isFIFO:
string_final += string_tmp
Expand Down Expand Up @@ -355,12 +375,9 @@ def writeTestBench(tbfunc, topfunc, process_list, memDict, memInfoDict, memPrint
string_header += writeTBOpener(tbfunc)

string_constants = writeTBConstants(memDict, memInfoDict, notfinal_procs+[final_procs[-1].mtype_short()], memPrintsDir, sector, split)
# A bodge for TrackBuilder to write TF concatenated track+stub data.
# (Needed to compare with emData/).
if 'TW_104' in memInfoDict.keys():
fileTF = open("bodge/TF_tb_constants.vhd.bodge")
string_constants += fileTF.read();

if len([key for key in memInfoDict if key.startswith('TW_')]) > 0:
string_constants += 'constant FILE_OUT_TF : string := dataOutDir&"TF_";';

string_ctrl_signals = writeTBControlSignals(memDict, memInfoDict, initial_proc, final_procs, notfinal_procs,split, MPARdict)

string_begin = writeTBEntityBegin()
Expand Down