Article View: comp.lang.verilog
Article #103Concantenation Problems
From: Belliappa Kuttanna
Date: Fri, 09 Oct 1992 18:52
Date: Fri, 09 Oct 1992 18:52
25 lines
1095 bytes
1095 bytes
I have been trying to model the shift right/left operations wherein I
shift a register by a variable amount (specified within the instruction).
This is the way I tried to do it:
parameter WIDTH = 32;
`define SHAMT IR[10 : 6]
reg [WIDTH - 1 : 0] op2,temp,result,IR;
.
.
.
.
result = {{`SHAMT{op2[WIDTH-1]}},temp[WIDTH - `SHAMT - 1:0]};
I keep getting the following error message :
Error! Non-constant part-select index [Verilog-NCPSI]
"r2k.v", 560: temp[WIDTH - IR[10 : 6] - 1:0]
The manual says that you cannot concantenate with non-constant widths.
Any ideas on how to get around this problem ?
Thanks in advance.
Belliappa Kuttanna kuttanna@ee.tamu.edu
Technical Details
Message-ID:
<1992Oct9.185221.10612@tamsun.tamu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!tamsun.tamu.edu!eemips.tamu.edu!kuttannaShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.verilog Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!tamsun.tamu.edu!eemips.tamu.edu!kuttanna From: kuttanna@eemips.tamu.edu (Belliappa Kuttanna) Subject: Concantenation Problems Message-ID: <1992Oct9.185221.10612@tamsun.tamu.edu> Sender: news@tamsun.tamu.edu (Read News) Organization: Texas A&M University Date: Fri, 9 Oct 1992 18:52:21 GMT Lines: 25