Electronics 板


LINE

目前遇到的问题就是使用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
1F:推 pupucar:init CLK=0 试试 09/07 17:09
2F:→ arloha:刚刚试着改initial clk=0 结果计数器在16~31还是"x" 09/07 17:49
3F:推 pupucar:你做的是pre-sim吗? 试试看assign #2 addr = cntr[3:0] 09/07 18:34
4F:→ pupucar:就是CNTR值出来後多#2 在灌进去MEM的ADDR 09/07 18:35
5F:推 bakerly:warning message写了,你的address的hold time 不够, 09/07 19:09
6F:→ bakerly:把你的address加一点延迟再送进去就好了。 09/07 19:09
7F:→ bakerly:印象中好像加上"notimingcheck"把timing check 关掉也可以 09/07 19:15
8F:→ arloha:恩~~加上delay就可以了 09/07 22:06
9F:→ arloha:不过想顺便问.....pre-sim不是没有考虑delay那些 09/07 22:08
10F:→ arloha:这里要加上delay.....似乎变成有考虑delay的问题? 09/07 22:09
11F:推 ilovepachaya:synthesis完的pre-sim是有考虑delay的 有读入sdf档 09/07 22:43
12F:→ arloha:阿....应该说我目前只有做function模拟,还没有合成 09/07 22:48
13F:推 pupucar:我猜是你用的memory model的关系 看一下datasheet有没有写 09/07 22:53
14F:推 bakerly:artisan产生的mem里面有含timingcheck的部分,跟你跑什麽 09/08 09:24
15F:→ bakerly:模没关系,你打开看一下.v就可以看到,tool defaul会检查 09/08 09:25
16F:→ bakerly:除非你自己把它关掉。 09/08 09:26
17F:→ arloha:恩~~mem里面的确有含timingcheck的部分...谢谢了 09/08 11:48
18F:→ sneak: init CLK=0 https://noxiv.com 08/13 18:47
19F:→ sneak: 恩~~mem里面的确有 https://daxiv.com 09/17 22:43
20F:→ sneak: 不过想顺便问..... https://muxiv.com 11/11 15:23
21F:→ sneak: 刚刚试着改initia https://noxiv.com 01/04 22:01







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:iOS 或 站内搜寻

TOP