完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
module zhen_jing(pi_clk,rst_n,cout);
input pi_clk; input rst_n; output reg[7:0] cout; reg [19:0] div_cnt; reg clk_c; reg div_end; parameter d_size=19'd499999; //分频 always@(posedge pi_clk or negedge rst_n) begin if(!rst_n) begin div_cnt<=0; clk_c<=0; end else begin if(div_cnt==d_size) begin clk_c<=~clk_c; div_cnt<=0; end else div_cnt<=div_cnt+1'b1; end end //计数 always@(negedge clk_c or negedge rst_n) if(!rst_n) cout<='d0; else if(div_end) begin cout<=cout+1'b1; if(cout==8'd255) div_end<=1'b0; else div_end<=1'b1; end else begin cout<=cout-'d51; if(cout==0) div_end<=1'b1; else div_end<=1'b0; end endmodule `timescale 1ns/1ns module tb_zhen_jing; reg clk,clr,clk_r; wire cout_c; initial begin clk<=0; clr<=0; #30 clr<=1; end always #10 clk<=~clk; zhen_jing zhen_jing_inst( .pi_clk(clk), .rst_n(clr), .clk_c(clk_r), .cout(cout_c) ); endmodule 编译没问题,但仿真有问题,问题如下,求指导啊 ** Error: (vsim-3389) D:/project/sim/tb_zhen_jing.v(21): Port 'clk_c' not found in the connected module (3rd connection). # # Region: /tb_zhen_jing/zhen_jing_inst # ** Fatal: (vsim-3365) D:/project/sim/tb_zhen_jing.v(21): Too many port connections. Expected 3, found 4. # Time: 0 ns Iteration: 0 Instance: /tb_zhen_jing/zhen_jing_inst File: D:/project/design/zhen_jing.v # FATAL ERROR while loading design # Error loading design |
|
相关推荐
2个回答
|
|
模块端口命名如果和标准库中重复的话,仿真的时候可能会出现这种错误,可以检查下Port 'clk_c'看看能不能通过。
|
|
|
|
FPGA?表示看不懂代码
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
求FPGA 驱动控制ltc2271 或者 ltc2180 或者 ltc2190或者 ltc2202 的代码
841 浏览 0 评论
343 浏览 0 评论
求助:遇见诡异问题,FPGA模块A输出端口连接模块B输入后,模块A不能正常工作的
1029 浏览 1 评论
406 浏览 0 评论
966 浏览 1 评论
3888 浏览 89 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-3 07:18 , Processed in 0.481489 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号