最新日志

发表于:2006-11-21 16:12:22
标签:FPGA  rom  

1

求助!ROm型文件怎么弄

要作一个查找表作一个ROM型的正弦,但是不知道怎么开始,请指一条路给我!

点击此处查看原文 >>

系统分类: CPLD/FPGA   |    用户分类: 无分类    |    来源: 无分类

评论(2) | 阅读(1086)
发表于:2006-11-14 11:41:32
标签:FPGA  时序仿真  

1

保持时间是负的。帮忙!

我的那个项目,时序仿真后保持时间都是负的,怎么办?帮忙

点击此处查看原文 >>

系统分类: CPLD/FPGA   |    用户分类: 无分类    |    来源: 无分类

评论(2) | 阅读(958)
发表于:2006-11-13 23:32:34
标签:FPGA  时序仿真  

1

功能仿真是正确的,时序仿真时没有输出!求救高手知道!

我刚刚编的程序,终于学会怎样进行时序仿真的,可是谁知道功能仿真是正确的,时序仿真的时候确没有输出结果,我把我的源代码传上来,肯请高手们帮我看一下我应该从那找错!

源代码:

/*It is a program of series input data to parallel out data,
which is used in 16DAPSK*/
`timescale 1us/1ns
module series_to_parallel(series_in,
    convert_clk,
    out_clk,
     convert_rst,
     parallel_out,
     convert_out,
     convert_begin,
              busy);
input series_in;
input convert_clk;
input out_clk;
input convert_rst;
input convert_begin;
output[3:0] parallel_out;
output[3:0] convert_out;
output busy;
reg[3:0] parallel_out;
reg[3:0] convert_out;
reg busy;
reg [5:0] shift_state;
//reg convert_begin;
parameter shift_state_begin="6"'b100000;
parameter shift_state_bit0=6'b000010;
parameter shift_state_bit1=6'b000100;
parameter shift_state_bit2=6'b001000;
parameter shift_state_bit3=6'b010000;
parameter shift_state_end= 6'b000001;
always @(posedge convert_rst or posedge convert_clk)
begin
 if(convert_rst)
 begin
   //busy<=1'b1;
   //convert_begin<=1'b1;
   if(convert_begin)
      begin
         shift_state<=shift_state_begin;
         parallel_out<=4'b0000;
      end
    else
      begin
          shift_state<=shift_state_end;
          parallel_out<=4'b0000;
      end
    end
    else
     begin
       case(shift_state)
       
   shift_state_begin:
   begin
    if(convert_begin)
     begin
      shift_state<=shift_state_bit3;
      busy<=1'b1;
     end
    else
     begin
      shift_state<=shift_state_end; 
      busy<=1'b0;
     end  
   end 
   shift_state_bit3:
   begin
    if(convert_begin)
     begin
      parallel_out[3]<=series_in;
      shift_state<=shift_state_bit2;
      busy<=1'b1;
     end
    else
     begin
      shift_state<=shift_state_end;
      busy<=1'b0;
     end
   end 
   shift_state_bit2:
   begin
    if(convert_begin)
     begin
      parallel_out[2]<=series_in;
      shift_state<=shift_state_bit1;
      busy<=1'b1;
     end
    else
        begin
      shift_state<=shift_state_end;
      busy<=1'b0;
     end
   end
   shift_state_bit1:
   begin
    if(convert_begin)
     begin
      parallel_out[1]<=series_in;
      shift_state<=shift_state_bit0;
      busy<=1'b1;
     end
    else
     begin
      shift_state<=shift_state_end;
      busy<=1'b0;
     end
   end
   shift_state_bit0:
   begin
    if(convert_begin)
    begin
     parallel_out[0]<=series_in;
     shift_state<=shift_state_bit3;
     busy<=1'b1;
    end
    else
     begin
      shift_state<=shift_state_end;
      busy<=1'b0;
     end
   end
   shift_state_end:
   begin
    if(convert_begin)
     begin
      shift_state<=shift_state_begin;
      busy<=1'b1;
     end
    else
     begin
     shift_state<=shift_state_end;
      busy<=1'b0;
     end
   end
   default:
    begin
     shift_state<=shift_state_end;
     //convert_begin<=1'b0;
    end
   
   endcase
 end
 //busy<=1'b0;
end
//?????????1/4??????
always@(posedge out_clk or posedge convert_rst)
   begin
       if(convert_rst)
             convert_out<=4'b0000;
        else
             convert_out<=parallel_out;
   end

endmodule
    
    

testbench代码:

`timescale 1us/1ns //时间单位为500ns,不知道那个精度时间是什么意思

module test_series_to_pallel;
//`include "series_to_parallel.v"
reg test_series_in;
reg test_convert_clk;
reg test_convert_rst;
reg out_clk;
wire[3:0] test_parallel_out;
wire[3:0] convert_out;
reg convert_begin;
wire test_busy;
parameter half_period="1";
initial
begin
test_convert_clk="0";
out_clk="0";
end


initial
begin
#1 test_convert_rst="1";
#1 test_convert_rst="0";
end
initial
begin
#1 convert_begin="1";
#400 convert_begin="0";
end
always #half_period test_convert_clk=~test_convert_clk;
always #4 out_clk=~out_clk;
always @(negedge test_convert_clk)
begin
test_series_in={$random}%2;
end
series_to_parallel test_series_to_parallel(.series_in(test_series_in),
                   .convert_clk(test_convert_clk),
                    .out_clk(out_clk),
                   .convert_rst(test_convert_rst),
                   .parallel_out(test_parallel_out),
                   .convert_out(convert_out),
                   .convert_begin(convert_begin),
                   .busy(test_busy));
endmodule

全编译的时候出现的警告:

Warning: Verilog HDL Always Construct warning at series_to_parallel.v(37): variable "convert_begin" is read inside the Always Construct but isn't in the Always Construct's Event Control
Warning: Timing Analysis found one or more latches implemented as combinational loops
 Warning: Node "shift_state.shift_state_end~7" is a latch
Warning: Found pins functioning as undefined clocks and/or memory enables
 Info: Assuming node "convert_clk" is an undefined clock
 Info: Assuming node "out_clk" is an undefined clock

 

点击此处查看原文 >>

系统分类: CPLD/FPGA   |    用户分类: 无分类    |    来源: 无分类

评论(5) | 阅读(1396)
发表于:2006-11-11 13:21:10
标签:FPGA  MOdelsim  功能仿真  

0

在modelsim中进行功能仿真时遇到的问题。

各位谢谢你来到我的博客

我正在利用Quartus和Modelsim进行硬件设计,刚刚开始我写下我做的过程和困难,如果您看到我的问题,请您帮忙

其实是一个很简单的程序串并转化:test_series_to_parallel.测试模块是test_series_to_parallel

第一步我是在Quartus中分析综和布局布线后,没有错误,有几个warning

Warning: Timing Analysis found one or more latches implemented as combinational loops
 Warning: Node "shift_state.shift_state_end~7" is a latch
 Warning: Node "shift_state.shift_state_begin~7" is a latch
Warning: Found pins functioning as undefined clocks and/or memory enables
 Info: Assuming node "out_clk" is an undefined clock
Warning: Clock Setting "clock" is unassigned

我觉得应该不影响我的功能仿真

第二步我进入了Modelsim中

1、建立了工程,把 我在Quartus中的源代码(test_series_to_parallel、test_series_to_parallel)考到我在modelsim新建的project中

  这一步的问题是:我要不要把得到的网表文件.vo和延时反标文件.sdo一起考过来?

2、我在所有的参考书上都说什么仿真库的编译和映射,

        第一种方法:在altera的安装目录下quartus\eda\sim_lib中所涉及的Altera的仿真库(是用到的那个器件的Veriog程序吗)的Verilog拷贝到工程目录下,并加入到工程中

       第二种方法:在主菜单中选择【file】/【new】【library】中弹出的[create a new library]的对话框中选择a map to  an exitising ,单击[browse]选择已编译的库【问题】(1、这个已编译的库是说的我自己编译的那个project中的work库吗?2是那个新的library的名字是那个是我自己订的吗,这个库有什么用处)

      3编译源代码:选择所有源代码,然后compile all,成功

    4 启动仿真器并加载设计顶层

       在simulate中执行start simulate中的design我选择我的test_series_to_parallel.v[出现错误:Loading work.test_series_to_pallel
# Loading E:/myprogram/Verilog/modelsim/stop_timing_test/work.series_to_parallel
# ** Error: (vsim-3033) E:/myprogram/Verilog/modelsim/stop_timing_test/series_to_parallel.vo(78): Instantiation of 'AND1' failed. The design unit was not found.
#         Region: /test_series_to_pallel/test_series_to_parallel
#         Searched libraries:
#             E:/myprogram/Verilog/modelsim/stop_timing_test/work
#             E:/myprogram/Verilog/modelsim/stop_timing_test/work]

 

添加library在那?

我就作到这就作不下去,问题太多对不起,那位神仙帮帮忙! 

 

 

 

点击此处查看原文 >>

系统分类: CPLD/FPGA   |    用户分类: 无分类    |    来源: 无分类

评论(3) | 阅读(1657)
总共 , 当前 /