在用fpga产生正弦波,调用ISE 的ROM 内核,但是在仿真时,结果输出均为高阻态。ROM的数据由MATLAB产生,请问是为什么??
module sincose(data,we,clk,ce,reset,sine
);
input we;//enable system
input clk;
input ce;//enable dds
input reset;
input [31:0] data;
output [15:0] sine;
reg [31:0] ADD_A;
reg [31:0] ADD_B;//phase adder
reg [15:0] sine_dr;
initial ADD_B=0;
wire [9:0] ROM_A;
wire [15:0] sine_d;
assign sine=sine_dr;
assign ROM_A=ADD_B[31:22];//
always@(posedge clk or posedge reset) //enabe SYSTEM
begin
if(reset)
ADD_A<=0;
else if(we)
ADD_A<=data;
end
always@(posedge clk or posedge reset) //enable dds
begin
if(reset)
ADD_B<=0;
else if(ce)
ADD_B<=ADD_B+ADD_A;///
end
always@(posedge clk or posedge reset)
begin
if(reset)
sine_dr<=0;
else if(ce)
sine_dr<=sine_d;
end
rom_sine sine1(.addr(ROM_A),.clk(clk),.dout(sine_d));
endmodule
此帖出自
小平头技术问答
一周热门 更多>