Skip to content

Commit 174c325

Browse files
authored
BX synchronization (#64)
* Added changes to propagate TP_bx_vld to tf_merge_stream and output bx from merge_stream module * Cleanup comment * Incorporate Andrew's suggestion; make TPAR memories into URAM
1 parent 68630ed commit 174c325

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

WriteVHDLSyntax.py

+16-4
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ def writeTopLevelMemoryType(mtypeB, memList, memInfo, extraports, delay = 0, spl
420420

421421
interface = int(memInfo.is_final) - int(memInfo.is_initial)
422422

423+
first_merge_streamer = True
424+
423425
for memmod in memList:
424426

425427
nmem = 0
@@ -592,6 +594,8 @@ def writeTopLevelMemoryType(mtypeB, memList, memInfo, extraports, delay = 0, spl
592594
parameterlist += " NUM_PHI_BINS => 8,\n"
593595
parameterlist += " NUM_RZ_BINS => 16,\n"
594596
parameterlist += " NUM_COPY => "+str(ncopy)+"\n"
597+
if "TPAR" in mem:
598+
parameterlist += " MEM_TYPE => \"ultra\",\n"
595599

596600
#FIXME implement delay for disks
597601
# Write ports
@@ -646,10 +650,16 @@ def writeTopLevelMemoryType(mtypeB, memList, memInfo, extraports, delay = 0, spl
646650
merge_parameterlist += " NUM_INPUTS => "+str(numInputs)+",\n"
647651
merge_parameterlist += " NUM_EXTRA_BITS => 2,\n"
648652
merge_portlist += " bx_in => TP_bx_out,\n"
653+
merge_portlist += " bx_in_vld => TP_bx_out_vld,\n"
649654
merge_portlist += " rst => '0',\n"
650655
merge_portlist += " clk => clk,\n"
651656
merge_portlist += " enb_arr => open,\n"
652-
merge_portlist += " bx_out => open,\n"
657+
#This will make output for first stream_merge module (is there a less hacky way?)
658+
if first_merge_streamer:
659+
merge_portlist += " bx_out => TP_bx_out_merged,\n"
660+
first_merge_streamer = False
661+
else:
662+
merge_portlist += " bx_out => open,\n"
653663
merge_portlist += " merged_dout => MPAR_"+seed+PCGroup+"_stream_V_dout,\n"
654664
for i in range(4): merge_portlist += " din"+str(i)+"=>TPAR_"+seed+PCGroup[i%numInputs]+"_V_dout,\n"
655665
for i in range(4): merge_portlist += " nent"+str(i)+"=>TPAR_"+seed+PCGroup[i%numInputs]+"_AV_dout_nent,\n"
@@ -668,6 +678,7 @@ def writeTopLevelMemoryType(mtypeB, memList, memInfo, extraports, delay = 0, spl
668678
merge_parameterlist += " NUM_INPUTS => "+str(numInputs)+",\n"
669679
merge_parameterlist += " NUM_EXTRA_BITS => 0,\n"
670680
merge_portlist += " bx_in => TP_bx_out,\n"
681+
merge_portlist += " bx_in_vld => TP_bx_out_vld,\n"
671682
merge_portlist += " rst => '0',\n"
672683
merge_portlist += " clk => clk,\n"
673684
merge_portlist += " enb_arr => open,\n"
@@ -782,6 +793,8 @@ def writeControlSignals_interface(initial_proc, final_procs, notfinal_procs, del
782793
string_ctrl_signals += " reset : in std_logic;\n"
783794
string_ctrl_signals += " "+initial_proc+"_start : in std_logic;\n"
784795
string_ctrl_signals += " "+initial_proc+"_bx_in : in std_logic_vector(2 downto 0);\n"
796+
if split == 1:
797+
string_ctrl_signals += " TP_bx_out_merged : out std_logic_vector(2 downto 0);\n"
785798
if split == 2:
786799
string_ctrl_signals += " "+initial_proc+"_bx_out : out std_logic_vector(2 downto 0);\n"
787800
string_ctrl_signals += " "+initial_proc+"_bx_out_vld : out std_logic;\n"
@@ -1527,8 +1540,7 @@ def writeStartSwitchAndInternalBX(module,mem,extraports=False, delay = 0, first_
15271540
int_ctrl_func += " bx => PC_bx_out,\n"
15281541
int_ctrl_func += " start => PC_done\n"
15291542
int_ctrl_func += " );\n\n"
1530-
1531-
1543+
15321544
if first_proc:
15331545
mtype_up = module.mtype_short()
15341546
else:
@@ -1613,7 +1625,7 @@ def writeProcBXPort(modName,isInput,isInitial,first_of_type,delay):
16131625
if first_of_type and not ("VMSMER" in modName or "PC" in modName):
16141626
bx_str += " bx_o_V => "+modName.split("_")[0]+"_bx_out,\n"
16151627
#bx_str += " bx_o_V_ap_vld => "+modName+"_bx_out_vld,\n"
1616-
if "FT_" in modName:
1628+
if ("FT_" in modName) or ("TP_" in modName):
16171629
bx_str += " bx_o_V_ap_vld => "+modName.split("_")[0]+"_bx_out_vld,\n"
16181630
else:
16191631
bx_str += " bx_o_V_ap_vld => open,\n"

0 commit comments

Comments
 (0)