0

Verilog HDL で 32 ビット パラレル イン パラレル アウトを実装しようとしています。ここに私が書いたコードがあります...

module pipo(input_seq, answer,reset, clock);
   input [31:0] input_seq;
   input        reset,clock;
   output [31:0] answer;

   always @ (reset)
     begin
        if(!reset)
          begin
             answer[31:0]<=1'b0;
          end
     end

   always @ (posedge clock)
     begin
        answer[31:1]<=input_seq[30:0];  
     end

endmodule

ただし、これにより次のエラーログが発生します( using iverilog):

pipo.v:10: error: answer['sd31:'sd0] is not a valid l-value in pipo.
pipo.v:4:      : answer['sd31:'sd0] is declared here as wire.
pipo.v:16: error: answer['sd31:'sd1] is not a valid l-value in pipo.
pipo.v:4:      : answer['sd31:'sd1] is declared here as wire.
Elaboration failed

問題は何ですか?

4

2 に答える 2

5

レジスタとして使用answerしていますが、ワイヤとして宣言されています。Wireは2点を結ぶものであり、駆動力はありません。一方、reg値と駆動力を保存できます。

toの宣言を変更answerするregと、役立つはずです。

output reg [31:0] answer;
于 2013-08-17T11:09:17.887 に答える