Commit 6f94346b authored by twlostow's avatar twlostow

Fixed a bug in remove_duplicates() causing missing clocks in entity port list

git-svn-id: http://svn.ohwr.org/wishbone-gen@15 4537843c-45c2-4d80-8546-c3283569414f
parent 8616b045
......@@ -233,7 +233,7 @@ function cgen_build_clock_list()
local i,v;
local clockports = {};
remove_duplicates(allclocks);
allclocks = remove_duplicates(allclocks);
for i,v in pairs(allclocks) do
table.insert(clockports, port(BIT, 0, "in", v, "", true));
......
......@@ -43,6 +43,6 @@ radix -hexadecimal
do wave.do
run 1000us
run 10us
wave zoomfull
......@@ -124,9 +124,9 @@ module main;
tsf_wr_req = 1;
tsf_wr_req <= 1;
@(posedge clk);
tsf_wr_req = 0;
tsf_wr_req <= 0;
end
endtask // ts_fifo_write
......@@ -167,13 +167,13 @@ module main;
WB.monitor_bus(0);
WB.verbose(0);
for(i=0;i<100;i=i+1) memacc_write(i, 3*i);
for(i=0;i<10;i=i+1) memacc_write(i, 3*i);
for(i=0;i<300;i=i+1) begin
ts_fifo_read(rd_val_r, rd_val_f, rd_pid, rd_fid);
$display("TS FIFO READ: val_f %d val_r %d pid %d fid %d", rd_val_f, rd_val_r, rd_pid, rd_fid);
for(i=0;i<5;i=i+1) begin
// ts_fifo_read(rd_val_r, rd_val_f, rd_pid, rd_fid);
// $display("TS FIFO READ: val_f %d val_r %d pid %d fid %d", rd_val_f, rd_val_r, rd_pid, rd_fid);
end
......@@ -211,8 +211,8 @@ module main;
initial begin
wait(WB.ready);
for(j=0;j<300;j=j+1)
ts_fifo_write(j, j+10, j+20, j+30);
// for(j=0;j<5;j=j+1)
// ts_fifo_write(j, j+10, j+20, j+30);
end
......
......@@ -8,6 +8,10 @@ add wave -noupdate -format Literal /main/tsf_val_r
add wave -noupdate -format Literal /main/tsf_val_f
add wave -noupdate -format Literal /main/tsf_pid
add wave -noupdate -format Literal /main/tsf_fid
add wave -noupdate -format Literal /main/dut/ft_tsf_in_int
add wave -noupdate -format Literal /main/dut/ft_tsf_out_int
add wave -noupdate -format Logic /main/dut/ft_tsf_rdreq_int
add wave -noupdate -format Logic /main/dut/ft_tsf_rdreq_int_d0
add wave -noupdate -format Logic /main/memacc_rd_req
add wave -noupdate -format Logic /main/memacc_rd_full
add wave -noupdate -format Logic /main/memacc_rd_empty
......@@ -35,7 +39,7 @@ add wave -noupdate -format Logic /main/WB/wb_we
add wave -noupdate -format Logic /main/WB/wb_rst
add wave -noupdate -format Logic /main/WB/wb_clk
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {61000000 ps} 0}
WaveRestoreCursors {{Cursor 1} {637405 ps} 0}
configure wave -namecolwidth 288
configure wave -valuecolwidth 100
configure wave -justifyvalue left
......@@ -49,4 +53,4 @@ configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
update
WaveRestoreZoom {57718750 ps} {64281250 ps}
WaveRestoreZoom {124709 ps} {1150101 ps}
......@@ -466,15 +466,30 @@ function tree_2_table(entry)
return tab;
end
function remove_duplicates(t)
local i=1,v,j;
while(t[i] ~= nil) do
for j=1,i-1 do if(t[j]==t[i]) then table.remove(t, i); i=i-1; end end
i=i+1;
function count_entries(tab, entry)
local i,v,cnt;
cnt=0;
for i,v in ipairs(tab) do if(v == entry) then cnt = cnt+1; end end
return cnt;
end
local t2={};
for i,v in ipairs(t) do
local cnt = count_entries(t2, v);
if(cnt == 0) then
table.insert(t2,v);
end
end
return t2;
end
function wbgen_count_subblocks()
local ramcount = 0;
local fifocount = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment