module CSHM #(parameter data_width=8,order=4)
(y,in,clk,reset_n);
wire [data_width-1:0]coeff[0:order-1];
output reg signed [2*data_width-1:0]y;
input clk,reset_n;
input signed[data_width-1:0]in;
integer i;
wire [15:0] product1,product2,product3,product4,product5,product6,product7,product8;
wire signed[3:0]lsboutputcoeff;
wire signed[7:4]msboutputcoeff;
wire signed[2:0]lsbcount,msbcount;
wire signed[2:0]lsbselect,msbselect;
wire signed[2*data_width-1:0]muxoutput,shiftoutlsb,shiftoutmsb;
wire [3:0] lsbcoeff;
wire [7:4] msbcoeff;
//reg [7:0] this_coeff;
wire [2:0]inputshift;
wire signed[15:0]muxout;
wire signed[15:0]leftshiftone,leftshifttwo,leftshiftthree;
wire [15:0]outputshift;
bankofprecomputers b1(.product1(product1),.product2(product2),.product3(product3),.product4(product4),.product5(product5),.product6(product6),.product7(product7),.product8(product8),.in(in));
genvar count;
generate
assign coeff[0]= 8'd1;
assign coeff[1]= 8'd2;
assign coeff[2]= 8'd3;
assign coeff[3]= 8'd4;
for(count = 0; count < order ; count = count+1)
begin : gen_loop
assign lsbcoeff = coeff[count][3:0];
assign msbcoeff = coeff[count][7:4];
shifter s1(.lsboutputcoeff(lsboutputcoeff),.msboutputcoeff(msboutputcoeff),.lsbselect(lsbselect),.msbselect(msbselect),.lsbcount(lsbcount),.msbcount(msbcount),.lsbcoeff(lsbcoeff),.msbcoeff(msbcoeff));
end
endgenerate
mux8_1msb m1(.muxoutput(muxoutput),.msbselect(msbselect),.product1(product1),.product2(product2),.product3(product3),.product4(product4),.product5(product5),.product6(product6),.product7(product7),.product8(product8));
mux8_1LSB m2(.muxoutput(muxoutput),.lsbselect(lsbselect),.product1(product1),.product2(product2),.product3(product3),.product4(product4),.product5(product5),.product6(product6),.product7(product7),.product8(product8));
inverse_shifter is1(.shiftoutmsb(shiftoutmsb),.muxoutput(muxoutput),.msbcount(msbcount));
inverse_shifter_LSB is2 (.shiftoutlsb(shiftoutlsb),.muxoutput(muxoutput),.lsbcount(lsbcount));
[email protected](negedge clk)
begin
y = shiftoutmsb+shiftoutlsb;
end
endmodule
當即時試圖合成,即時得到誤差作爲錯誤的Verilog,使用生成語句CSHM篩選編碼
多源在上信號lsbcoeff3股;這個信號是 連接到多個驅動程序。
多信號源單元信號lsbcoeff0;這個信號是 連接到多個驅動程序。
如果我錯在任何地方,請指導我
即時得到相同的錯誤... :( –
@SugureshKumarArali,更新問題中的代碼我懷疑你得到了完全相同的錯誤信息,如果你做了正確的更改,我看到相同的多驅動程序問題'lsboutputcoeff'和'msboutputcoeff'。提醒一下,生成塊中的循環並行運行,不是程序性的。 – Greg
好吧,但我有4個係數,必須分成LSB和MSB係數,必須更新請引導我,它是一個CSHM過濾器體系結構 –