[問題] 使用Artisan產生的memory問題

看板Electronics作者 (我要去澳洲玩!!!)時間16年前 (2009/09/07 16:12), 編輯推噓6(6015)
留言21則, 5人參與, 7年前最新討論串1/1
目前遇到的問題就是使用Artisan產生的sram無法得到正確的function模擬結果 而我所要的function為...... ========================================================================= 由一個計數器負責產生寫入以及讀取的address 在一開始計數0~15時,會做寫入的動作,位置是取計數器count[3:0]的位元 0000000,0000001,0000010,0000011.........,0001101,0001110,0001111 接著,16~31時會做讀取的動作,位置也是取計數器count[3:0]的位元 且count[4]位元是拿來判斷做讀取或寫入動作的依據 最後依照上面的敘述每16個clk重複執行做寫入.讀取.寫入.讀取..... ========================================================================= 現在遇到的問題是,計數器0~15時寫入的data,在計數器16~31時應該要輸出 但輸出卻是 x (don't care)的情況..... 所以想請一下有經驗的人幫忙看哪裡出錯了 因為我看過datasheet使用方法應該也沒弄錯 另外模擬軟體是用Verilog-XL 跟 Simvision 而在跑Verilog-XL時有出現 "sram_16x4.v", 399: Timing violation in test_tb.test.sram_16x4 $setuphold<hold>( posedge CLK &&& re_flag:1000000, posedge A[0]:1000000, 1.000 : 1000, 0.500 : 500 ); 這樣的訊息 下面是我的程式碼.... PS:sram_16x4.v是由Artisan memory comiler產生,code有點長,如有需要再附上了 ========================================================================== `timescale 1ns / 1ps module test(in,rst,clk,count,out); input rst; input clk; input [3:0]in; output [6:0]count; output [3:0]out; wire [6:0]count; counter128 c128(clk,rst,count); sram_16x4 sram_16x4(out,clk,1'b0,count[4],count[3:0],in,~count[4]); // sram_16x4 ( Q,CLK,CEN,WEN, A, D, OEN ); endmodule module counter128(clk, rst,count); input clk; input rst; output [6:0] count; wire [6:0] count; reg [6:0] counter_in; assign count=counter_in; always@(posedge clk) if(rst) counter_in<=1'b0; else counter_in<=counter_in+1'b1; endmodule ============================下面是testbench=========================== `timescale 1ns / 1ps module test_tb; reg rst; reg clk; reg [3:0] in; wire [3:0] out; wire [6:0] count; test test(in,rst,clk,count,out); always #10 clk=~clk; initial begin // Initialize Inputs rst = 1; clk = 1; in = 0; #40 rst=0; #20 in=1; #20 in=3; #20 in=5; #20 in=3; #20 in=2; #20 in=7; #20 in=9; #20 in=7; #20 in=6; #20 in=4; #20 in=2; #20 in=1; #20 in=4; #20 in=7; #20 in=2; #20 in=3; ///////// #20 in=6; #20 in=8; #20 in=6; #20 in=4; #20 in=7; #20 in=9; #20 in=5; #20 in=4; #20 in=2; #20 in=6; #20 in=4; #20 in=2; #20 in=1; #20 in=4; ////////// #20 in=2; #20 in=3; #20 in=4; #20 in=4; #20 in=4; #20 in=7; #20 in=7; #20 in=3; #20 in=1; #20 in=4; #20 in=6; #20 in=3; #20 in=6; #20 in=5; #100 $finish; end initial begin $dumpfile("test.vcd"); $dumpvars(0,test); end endmodule -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.118.107.144

09/07 17:09, , 1F
init CLK=0 試試
09/07 17:09, 1F

09/07 17:49, , 2F
剛剛試著改initial clk=0 結果計數器在16~31還是"x"
09/07 17:49, 2F

09/07 18:34, , 3F
你做的是pre-sim嗎? 試試看assign #2 addr = cntr[3:0]
09/07 18:34, 3F

09/07 18:35, , 4F
就是CNTR值出來後多#2 在灌進去MEM的ADDR
09/07 18:35, 4F

09/07 19:09, , 5F
warning message寫了,你的address的hold time 不夠,
09/07 19:09, 5F

09/07 19:09, , 6F
把你的address加一點延遲再送進去就好了。
09/07 19:09, 6F

09/07 19:15, , 7F
印象中好像加上"notimingcheck"把timing check 關掉也可以
09/07 19:15, 7F

09/07 22:06, , 8F
恩~~加上delay就可以了
09/07 22:06, 8F

09/07 22:08, , 9F
不過想順便問.....pre-sim不是沒有考慮delay那些
09/07 22:08, 9F

09/07 22:09, , 10F
這裡要加上delay.....似乎變成有考慮delay的問題?
09/07 22:09, 10F

09/07 22:43, , 11F
synthesis完的pre-sim是有考慮delay的 有讀入sdf檔
09/07 22:43, 11F

09/07 22:48, , 12F
阿....應該說我目前只有做function模擬,還沒有合成
09/07 22:48, 12F

09/07 22:53, , 13F
我猜是你用的memory model的關係 看一下datasheet有沒有寫
09/07 22:53, 13F

09/08 09:24, , 14F
artisan產生的mem裡面有含timingcheck的部分,跟你跑什麼
09/08 09:24, 14F

09/08 09:25, , 15F
模沒關係,你打開看一下.v就可以看到,tool defaul會檢查
09/08 09:25, 15F

09/08 09:26, , 16F
除非你自己把它關掉。
09/08 09:26, 16F

09/08 11:48, , 17F
恩~~mem裡面的確有含timingcheck的部分...謝謝了
09/08 11:48, 17F

08/13 18:47, , 18F
08/13 18:47, 18F

09/17 22:43, , 19F
恩~~mem裡面的確有 https://daxiv.com
09/17 22:43, 19F

11/11 15:23, , 20F
不過想順便問..... https://muxiv.com
11/11 15:23, 20F

01/04 22:01, 7年前 , 21F
剛剛試著改initia https://noxiv.com
01/04 22:01, 21F
文章代碼(AID): #1AfC1RiM (Electronics)