查看: 4821|回复: 1

[提问] 为何除法器IP内核仿真总是高阻状态

[复制链接]
发表于 2011-5-16 21:01:09 | 显示全部楼层 |阅读模式
10积分
我刚开始玩FPGA,发现不能直接使用除法,需要使用除法内核(暂时没考虑自己别写除法程序)。
我尝试了IP内核中的Math Functions--dividers, 里面有2个IP核,我都试过了,仿真的时候输出总是高阻状态。
我使用的是Xilinx Spatan3, ISE10.1, Verilog语言,采用自带的ISE Simulator仿真器, 使用编写Verilog Test Fixture的方法仿真。
例如,我利用divider generator V1.0生成my_div模块,并实例化,程序如下:

module div(clk, ce, dividend, divisor, quotient, remainder);
    input clk;
    input ce;
    input [7:0] dividend;
    input [7:0] divisor;
    output [7:0] quotient;
    output [7:0] remainder;

    my_div test(
    .clk(clk),
    .ce(ce),
    .aclr(1'b0),
    .sclr(1'b0),
    .dividend(dividend),
    .divisor(divisor),
    .quotient(quotient),
    .remainder(remainder),
    .rfd());

endmodule

然后仿真程序如下:
module test;
     // Inputs
     reg clk;
     reg ce;
     reg [7:0] dividend;
     reg [7:0] divisor;
     // Outputs
     wire [7:0] quotient;
     wire [7:0] remainder;

     // Instantiate the Unit Under Test (UUT)
    div uut (
    .clk(clk),
    .dividend(dividend),
    .divisor(divisor),
    .quotient(quotient),
    .remainder(remainder)
     );

   initial begin
   forever #10 clk = ~clk;
   end

   initial begin
   // Initialize Inputs
  clk = 0;
  ce = 0;
  dividend = 0;
  divisor = 0;
  // Wait 100 ns for global reset to finish
  #100;
  dividend = 100;
  divisor = 12;
  #10;
  ce = 1;
  #500 $stop;
      end
  // Add stimulus here
endmodule

但是进入仿真后,quotient与remainder输出总是高电平(见图片),试过好多次了都是这样。
请问大家遇到过这种情况没?
求解原因!谢谢!

1.jpg
 楼主| 发表于 2011-5-16 21:18:07 | 显示全部楼层
对了,是试过其他一些IP核的仿真,都没有问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关于我们  -  服务条款  -  使用指南  -  站点地图  -  友情链接  -  联系我们
电子工程网 © 版权所有   京ICP备16069177号 | 京公网安备11010502021702
快速回复 返回顶部 返回列表