FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-18-2006, 05:17 PM
Guest
 
Posts: n/a
Default Port mode is incompatible error

I keep getting Error on line 31: Port mode is incompatible with
declaration: A

Same thing for B.

This is line 31 that gives error: reg [15:0] A,B;

Here is the code:
************************************************** **********************************

module alu16(A,B,C,alu_code,overflow);

/************************************************** **
16 bit arithmetic logic unit

parameter:
A.........16-bit A bidirectional
B.........16-bit B input
alu_code..5-bit operation to perform
C.........16-bit bit result output
overflow..overflow status (used for signed operations)
************************************************** **/
inout [15:0] A;
input [15:0] B;
input [4:0] alu_code;
output [15:0] C;
output overflow;

//internal nodes

reg [15:0] A,B;
reg [15:0] C;
reg overflow;

always @ (A or B or alu_code) begin

//ARITHMETIC OPERATIONS

if(alu_code[4:3] == 2'b00) begin
case (alu_code[2:0])
3'b000:C = !((!A + 1) + (!B + 1) + 1); //signed 2's complement
addition
3'b001:C = A + B;
3'b010:C = !((!A + 1) - (!B + 1) + 1); //signed 2's complement
subtraction
3'b011:C = A - B;
3'b100:C = A + 1;
3'b101:C = A - 1;
default:C = 8'bx;
endcase
overflow = C[15]^C[14];
end

//LOGIC OPERATIONS

else if(alu_code[4:3] == 2'b01) begin
case (alu_code[2:0])
3'b000:C = A && B;
3'b001:C = A || B;
3'b010:C = ((!A)&&(B) || (A)&&(!B));
3'b000:C = !A;
default:C = 8'bx;
endcase
end

//SHIFT OPERATIONS (<< >> are logical shifts, <<< >>> are arithmetic
shifts in Verilog2001 and SystemVerilog)

else if (alu_code[4:3] == 2'b10) begin
case (alu_code[2:0])
3'b000:
if(B[3:0] == 4'b0000) A = A << 0;
else if(B[3:0] == 4'b0001) A = A << 1;
else if(B[3:0] == 4'b0010) A = A << 2;
else if(B[3:0] == 4'b0011) A = A << 3;
else if(B[3:0] == 4'b0100) A = A << 4;
else if(B[3:0] == 4'b0101) A = A << 5;
else if(B[3:0] == 4'b0110) A = A << 6;
else if(B[3:0] == 4'b0111) A = A << 7;
else if(B[3:0] == 4'b1000) A = A << 8;
else if(B[3:0] == 4'b1001) A = A << 9;
else if(B[3:0] == 4'b1010) A = A << 10;
else if(B[3:0] == 4'b1011) A = A << 11;
else if(B[3:0] == 4'b1100) A = A << 12;
else if(B[3:0] == 4'b1101) A = A << 13;
else if(B[3:0] == 4'b1110) A = A << 14;
else if(B[3:0] == 4'b1111) A = A << 15;
3'b001:
if(B[3:0] == 4'b0000) A = A >> 0;
else if(B[3:0] == 4'b0001) A = A >> 1;
else if(B[3:0] == 4'b0010) A = A >> 2;
else if(B[3:0] == 4'b0011) A = A >> 3;
else if(B[3:0] == 4'b0100) A = A >> 4;
else if(B[3:0] == 4'b0101) A = A >> 5;
else if(B[3:0] == 4'b0110) A = A >> 6;
else if(B[3:0] == 4'b0111) A = A >> 7;
else if(B[3:0] == 4'b1000) A = A >> 8;
else if(B[3:0] == 4'b1001) A = A >> 9;
else if(B[3:0] == 4'b1010) A = A >> 10;
else if(B[3:0] == 4'b1011) A = A >> 11;
else if(B[3:0] == 4'b1100) A = A >> 12;
else if(B[3:0] == 4'b1101) A = A >> 13;
else if(B[3:0] == 4'b1110) A = A >> 14;
else if(B[3:0] == 4'b1111) A = A >> 15;
3'b010:
if(B[3:0] == 4'b0000) A = A <<< 0;
else if(B[3:0] == 4'b0001) A = A <<< 1;
else if(B[3:0] == 4'b0010) A = A <<< 2;
else if(B[3:0] == 4'b0011) A = A <<< 3;
else if(B[3:0] == 4'b0100) A = A <<< 4;
else if(B[3:0] == 4'b0101) A = A <<< 5;
else if(B[3:0] == 4'b0110) A = A <<< 6;
else if(B[3:0] == 4'b0111) A = A <<< 7;
else if(B[3:0] == 4'b1000) A = A <<< 8;
else if(B[3:0] == 4'b1001) A = A <<< 9;
else if(B[3:0] == 4'b1010) A = A <<< 10;
else if(B[3:0] == 4'b1011) A = A <<< 11;
else if(B[3:0] == 4'b1100) A = A <<< 12;
else if(B[3:0] == 4'b1101) A = A <<< 13;
else if(B[3:0] == 4'b1110) A = A <<< 14;
else if(B[3:0] == 4'b1111) A = A <<< 15;
3'b000:
if(B[3:0] == 4'b0000) A = A >>> 0;
else if(B[3:0] == 4'b0001) A = A >>> 1;
else if(B[3:0] == 4'b0010) A = A >>> 2;
else if(B[3:0] == 4'b0011) A = A >>> 3;
else if(B[3:0] == 4'b0100) A = A >>> 4;
else if(B[3:0] == 4'b0101) A = A >>> 5;
else if(B[3:0] == 4'b0110) A = A >>> 6;
else if(B[3:0] == 4'b0111) A = A >>> 7;
else if(B[3:0] == 4'b1000) A = A >>> 8;
else if(B[3:0] == 4'b1001) A = A >>> 9;
else if(B[3:0] == 4'b1010) A = A >>> 10;
else if(B[3:0] == 4'b1011) A = A >>> 11;
else if(B[3:0] == 4'b1100) A = A >>> 12;
else if(B[3:0] == 4'b1101) A = A >>> 13;
else if(B[3:0] == 4'b1110) A = A >>> 14;
else if(B[3:0] == 4'b1111) A = A >>> 15;
endcase
end
end

//SET CONDITION OPERATIONS
endmodule

Reply With Quote
  #2 (permalink)  
Old 10-18-2006, 05:45 PM
Ajeetha
Guest
 
Posts: n/a
Default Re: Port mode is incompatible error

Inout can't be a "reg". Use a temporary reg/logic and assign it to the
inout if you really have to use inout. Inouts usually are not
preferred, in this design you may not even need it.

Regards
Ajeetha, CVC
www.noveldv.com

Reply With Quote
  #3 (permalink)  
Old 10-18-2006, 08:28 PM
Guest
 
Posts: n/a
Default Re: Port mode is incompatible error

Ok, I made the change( to make A an input and an internal wire, not
register), but now it gives this error:

** Error: alu16.v(70): (vlog-2110) Illegal reference to net "A".

For every line of code that tries to shift, for example:

else if (alu_code[4:3] == 2'b10) begin
case (alu_code[2:0])
3'b000:
if(B[3:0] == 4'b0000) A = A << 0;
else if(B[3:0] == 4'b0001) A = A << 1;
else if(B[3:0] == 4'b0010) A = A << 2;
else if(B[3:0] == 4'b0011) A = A << 3;
else if(B[3:0] == 4'b0100) A = A << 4;

I am trying shift vector A by the amount contained in B[3:0] -- between
0 and 15. Any help would be much appreciated.


/////////////////////////////////////////////////////////////////////////////
[email protected] wrote:
> I keep getting Error on line 31: Port mode is incompatible with
> declaration: A
>
> Same thing for B.
>
> This is line 31 that gives error: reg [15:0] A,B;
>
> Here is the code:
> ************************************************** **********************************
>
> module alu16(A,B,C,alu_code,overflow);
>
> /************************************************** **
> 16 bit arithmetic logic unit
>
> parameter:
> A.........16-bit A bidirectional
> B.........16-bit B input
> alu_code..5-bit operation to perform
> C.........16-bit bit result output
> overflow..overflow status (used for signed operations)
> ************************************************** **/
> inout [15:0] A;
> input [15:0] B;
> input [4:0] alu_code;
> output [15:0] C;
> output overflow;
>
> //internal nodes
>
> reg [15:0] A,B;
> reg [15:0] C;
> reg overflow;
>
> always @ (A or B or alu_code) begin
>
> //ARITHMETIC OPERATIONS
>
> if(alu_code[4:3] == 2'b00) begin
> case (alu_code[2:0])
> 3'b000:C = !((!A + 1) + (!B + 1) + 1); //signed 2's complement
> addition
> 3'b001:C = A + B;
> 3'b010:C = !((!A + 1) - (!B + 1) + 1); //signed 2's complement
> subtraction
> 3'b011:C = A - B;
> 3'b100:C = A + 1;
> 3'b101:C = A - 1;
> default:C = 8'bx;
> endcase
> overflow = C[15]^C[14];
> end
>
> //LOGIC OPERATIONS
>
> else if(alu_code[4:3] == 2'b01) begin
> case (alu_code[2:0])
> 3'b000:C = A && B;
> 3'b001:C = A || B;
> 3'b010:C = ((!A)&&(B) || (A)&&(!B));
> 3'b000:C = !A;
> default:C = 8'bx;
> endcase
> end
>
> //SHIFT OPERATIONS (<< >> are logical shifts, <<< >>> are arithmetic
> shifts in Verilog2001 and SystemVerilog)
>
> else if (alu_code[4:3] == 2'b10) begin
> case (alu_code[2:0])
> 3'b000:
> if(B[3:0] == 4'b0000) A = A << 0;
> else if(B[3:0] == 4'b0001) A = A << 1;
> else if(B[3:0] == 4'b0010) A = A << 2;
> else if(B[3:0] == 4'b0011) A = A << 3;
> else if(B[3:0] == 4'b0100) A = A << 4;
> else if(B[3:0] == 4'b0101) A = A << 5;
> else if(B[3:0] == 4'b0110) A = A << 6;
> else if(B[3:0] == 4'b0111) A = A << 7;
> else if(B[3:0] == 4'b1000) A = A << 8;
> else if(B[3:0] == 4'b1001) A = A << 9;
> else if(B[3:0] == 4'b1010) A = A << 10;
> else if(B[3:0] == 4'b1011) A = A << 11;
> else if(B[3:0] == 4'b1100) A = A << 12;
> else if(B[3:0] == 4'b1101) A = A << 13;
> else if(B[3:0] == 4'b1110) A = A << 14;
> else if(B[3:0] == 4'b1111) A = A << 15;
> 3'b001:
> if(B[3:0] == 4'b0000) A = A >> 0;
> else if(B[3:0] == 4'b0001) A = A >> 1;
> else if(B[3:0] == 4'b0010) A = A >> 2;
> else if(B[3:0] == 4'b0011) A = A >> 3;
> else if(B[3:0] == 4'b0100) A = A >> 4;
> else if(B[3:0] == 4'b0101) A = A >> 5;
> else if(B[3:0] == 4'b0110) A = A >> 6;
> else if(B[3:0] == 4'b0111) A = A >> 7;
> else if(B[3:0] == 4'b1000) A = A >> 8;
> else if(B[3:0] == 4'b1001) A = A >> 9;
> else if(B[3:0] == 4'b1010) A = A >> 10;
> else if(B[3:0] == 4'b1011) A = A >> 11;
> else if(B[3:0] == 4'b1100) A = A >> 12;
> else if(B[3:0] == 4'b1101) A = A >> 13;
> else if(B[3:0] == 4'b1110) A = A >> 14;
> else if(B[3:0] == 4'b1111) A = A >> 15;
> 3'b010:
> if(B[3:0] == 4'b0000) A = A <<< 0;
> else if(B[3:0] == 4'b0001) A = A <<< 1;
> else if(B[3:0] == 4'b0010) A = A <<< 2;
> else if(B[3:0] == 4'b0011) A = A <<< 3;
> else if(B[3:0] == 4'b0100) A = A <<< 4;
> else if(B[3:0] == 4'b0101) A = A <<< 5;
> else if(B[3:0] == 4'b0110) A = A <<< 6;
> else if(B[3:0] == 4'b0111) A = A <<< 7;
> else if(B[3:0] == 4'b1000) A = A <<< 8;
> else if(B[3:0] == 4'b1001) A = A <<< 9;
> else if(B[3:0] == 4'b1010) A = A <<< 10;
> else if(B[3:0] == 4'b1011) A = A <<< 11;
> else if(B[3:0] == 4'b1100) A = A <<< 12;
> else if(B[3:0] == 4'b1101) A = A <<< 13;
> else if(B[3:0] == 4'b1110) A = A <<< 14;
> else if(B[3:0] == 4'b1111) A = A <<< 15;
> 3'b000:
> if(B[3:0] == 4'b0000) A = A >>> 0;
> else if(B[3:0] == 4'b0001) A = A >>> 1;
> else if(B[3:0] == 4'b0010) A = A >>> 2;
> else if(B[3:0] == 4'b0011) A = A >>> 3;
> else if(B[3:0] == 4'b0100) A = A >>> 4;
> else if(B[3:0] == 4'b0101) A = A >>> 5;
> else if(B[3:0] == 4'b0110) A = A >>> 6;
> else if(B[3:0] == 4'b0111) A = A >>> 7;
> else if(B[3:0] == 4'b1000) A = A >>> 8;
> else if(B[3:0] == 4'b1001) A = A >>> 9;
> else if(B[3:0] == 4'b1010) A = A >>> 10;
> else if(B[3:0] == 4'b1011) A = A >>> 11;
> else if(B[3:0] == 4'b1100) A = A >>> 12;
> else if(B[3:0] == 4'b1101) A = A >>> 13;
> else if(B[3:0] == 4'b1110) A = A >>> 14;
> else if(B[3:0] == 4'b1111) A = A >>> 15;
> endcase
> end
> end
>
> //SET CONDITION OPERATIONS
> endmodule


Reply With Quote
  #4 (permalink)  
Old 10-18-2006, 09:59 PM
Guest
 
Posts: n/a
Default Re: Port mode is incompatible error


Do you also have to do synthesis for this homework assignment?
Which university is it?

Utku

[email protected] wrote:
> Ok, I made the change( to make A an input and an internal wire, not
> register), but now it gives this error:
>
> ** Error: alu16.v(70): (vlog-2110) Illegal reference to net "A".
>
> For every line of code that tries to shift, for example:
>
> else if (alu_code[4:3] == 2'b10) begin
> case (alu_code[2:0])
> 3'b000:
> if(B[3:0] == 4'b0000) A = A << 0;
> else if(B[3:0] == 4'b0001) A = A << 1;
> else if(B[3:0] == 4'b0010) A = A << 2;
> else if(B[3:0] == 4'b0011) A = A << 3;
> else if(B[3:0] == 4'b0100) A = A << 4;
>
> I am trying shift vector A by the amount contained in B[3:0] -- between
> 0 and 15. Any help would be much appreciated.
>
>
> /////////////////////////////////////////////////////////////////////////////
> [email protected] wrote:
> > I keep getting Error on line 31: Port mode is incompatible with
> > declaration: A
> >
> > Same thing for B.
> >
> > This is line 31 that gives error: reg [15:0] A,B;
> >
> > Here is the code:
> > ************************************************** **********************************
> >
> > module alu16(A,B,C,alu_code,overflow);
> >
> > /************************************************** **
> > 16 bit arithmetic logic unit
> >
> > parameter:
> > A.........16-bit A bidirectional
> > B.........16-bit B input
> > alu_code..5-bit operation to perform
> > C.........16-bit bit result output
> > overflow..overflow status (used for signed operations)
> > ************************************************** **/
> > inout [15:0] A;
> > input [15:0] B;
> > input [4:0] alu_code;
> > output [15:0] C;
> > output overflow;
> >
> > //internal nodes
> >
> > reg [15:0] A,B;
> > reg [15:0] C;
> > reg overflow;
> >
> > always @ (A or B or alu_code) begin
> >
> > //ARITHMETIC OPERATIONS
> >
> > if(alu_code[4:3] == 2'b00) begin
> > case (alu_code[2:0])
> > 3'b000:C = !((!A + 1) + (!B + 1) + 1); //signed 2's complement
> > addition
> > 3'b001:C = A + B;
> > 3'b010:C = !((!A + 1) - (!B + 1) + 1); //signed 2's complement
> > subtraction
> > 3'b011:C = A - B;
> > 3'b100:C = A + 1;
> > 3'b101:C = A - 1;
> > default:C = 8'bx;
> > endcase
> > overflow = C[15]^C[14];
> > end
> >
> > //LOGIC OPERATIONS
> >
> > else if(alu_code[4:3] == 2'b01) begin
> > case (alu_code[2:0])
> > 3'b000:C = A && B;
> > 3'b001:C = A || B;
> > 3'b010:C = ((!A)&&(B) || (A)&&(!B));
> > 3'b000:C = !A;
> > default:C = 8'bx;
> > endcase
> > end
> >
> > //SHIFT OPERATIONS (<< >> are logical shifts, <<< >>> are arithmetic
> > shifts in Verilog2001 and SystemVerilog)
> >
> > else if (alu_code[4:3] == 2'b10) begin
> > case (alu_code[2:0])
> > 3'b000:
> > if(B[3:0] == 4'b0000) A = A << 0;
> > else if(B[3:0] == 4'b0001) A = A << 1;
> > else if(B[3:0] == 4'b0010) A = A << 2;
> > else if(B[3:0] == 4'b0011) A = A << 3;
> > else if(B[3:0] == 4'b0100) A = A << 4;
> > else if(B[3:0] == 4'b0101) A = A << 5;
> > else if(B[3:0] == 4'b0110) A = A << 6;
> > else if(B[3:0] == 4'b0111) A = A << 7;
> > else if(B[3:0] == 4'b1000) A = A << 8;
> > else if(B[3:0] == 4'b1001) A = A << 9;
> > else if(B[3:0] == 4'b1010) A = A << 10;
> > else if(B[3:0] == 4'b1011) A = A << 11;
> > else if(B[3:0] == 4'b1100) A = A << 12;
> > else if(B[3:0] == 4'b1101) A = A << 13;
> > else if(B[3:0] == 4'b1110) A = A << 14;
> > else if(B[3:0] == 4'b1111) A = A << 15;
> > 3'b001:
> > if(B[3:0] == 4'b0000) A = A >> 0;
> > else if(B[3:0] == 4'b0001) A = A >> 1;
> > else if(B[3:0] == 4'b0010) A = A >> 2;
> > else if(B[3:0] == 4'b0011) A = A >> 3;
> > else if(B[3:0] == 4'b0100) A = A >> 4;
> > else if(B[3:0] == 4'b0101) A = A >> 5;
> > else if(B[3:0] == 4'b0110) A = A >> 6;
> > else if(B[3:0] == 4'b0111) A = A >> 7;
> > else if(B[3:0] == 4'b1000) A = A >> 8;
> > else if(B[3:0] == 4'b1001) A = A >> 9;
> > else if(B[3:0] == 4'b1010) A = A >> 10;
> > else if(B[3:0] == 4'b1011) A = A >> 11;
> > else if(B[3:0] == 4'b1100) A = A >> 12;
> > else if(B[3:0] == 4'b1101) A = A >> 13;
> > else if(B[3:0] == 4'b1110) A = A >> 14;
> > else if(B[3:0] == 4'b1111) A = A >> 15;
> > 3'b010:
> > if(B[3:0] == 4'b0000) A = A <<< 0;
> > else if(B[3:0] == 4'b0001) A = A <<< 1;
> > else if(B[3:0] == 4'b0010) A = A <<< 2;
> > else if(B[3:0] == 4'b0011) A = A <<< 3;
> > else if(B[3:0] == 4'b0100) A = A <<< 4;
> > else if(B[3:0] == 4'b0101) A = A <<< 5;
> > else if(B[3:0] == 4'b0110) A = A <<< 6;
> > else if(B[3:0] == 4'b0111) A = A <<< 7;
> > else if(B[3:0] == 4'b1000) A = A <<< 8;
> > else if(B[3:0] == 4'b1001) A = A <<< 9;
> > else if(B[3:0] == 4'b1010) A = A <<< 10;
> > else if(B[3:0] == 4'b1011) A = A <<< 11;
> > else if(B[3:0] == 4'b1100) A = A <<< 12;
> > else if(B[3:0] == 4'b1101) A = A <<< 13;
> > else if(B[3:0] == 4'b1110) A = A <<< 14;
> > else if(B[3:0] == 4'b1111) A = A <<< 15;
> > 3'b000:
> > if(B[3:0] == 4'b0000) A = A >>> 0;
> > else if(B[3:0] == 4'b0001) A = A >>> 1;
> > else if(B[3:0] == 4'b0010) A = A >>> 2;
> > else if(B[3:0] == 4'b0011) A = A >>> 3;
> > else if(B[3:0] == 4'b0100) A = A >>> 4;
> > else if(B[3:0] == 4'b0101) A = A >>> 5;
> > else if(B[3:0] == 4'b0110) A = A >>> 6;
> > else if(B[3:0] == 4'b0111) A = A >>> 7;
> > else if(B[3:0] == 4'b1000) A = A >>> 8;
> > else if(B[3:0] == 4'b1001) A = A >>> 9;
> > else if(B[3:0] == 4'b1010) A = A >>> 10;
> > else if(B[3:0] == 4'b1011) A = A >>> 11;
> > else if(B[3:0] == 4'b1100) A = A >>> 12;
> > else if(B[3:0] == 4'b1101) A = A >>> 13;
> > else if(B[3:0] == 4'b1110) A = A >>> 14;
> > else if(B[3:0] == 4'b1111) A = A >>> 15;
> > endcase
> > end
> > end
> >
> > //SET CONDITION OPERATIONS
> > endmodule


Reply With Quote
  #5 (permalink)  
Old 10-19-2006, 01:24 AM
Guest
 
Posts: n/a
Default Re: Port mode is incompatible error

Yes I will use ADK to synthesize.

[email protected] wrote:
> Do you also have to do synthesis for this homework assignment?
> Which university is it?
>
> Utku
>
> [email protected] wrote:
> > Ok, I made the change( to make A an input and an internal wire, not
> > register), but now it gives this error:
> >
> > ** Error: alu16.v(70): (vlog-2110) Illegal reference to net "A".
> >
> > For every line of code that tries to shift, for example:
> >
> > else if (alu_code[4:3] == 2'b10) begin
> > case (alu_code[2:0])
> > 3'b000:
> > if(B[3:0] == 4'b0000) A = A << 0;
> > else if(B[3:0] == 4'b0001) A = A << 1;
> > else if(B[3:0] == 4'b0010) A = A << 2;
> > else if(B[3:0] == 4'b0011) A = A << 3;
> > else if(B[3:0] == 4'b0100) A = A << 4;
> >
> > I am trying shift vector A by the amount contained in B[3:0] -- between
> > 0 and 15. Any help would be much appreciated.
> >
> >
> > /////////////////////////////////////////////////////////////////////////////
> > [email protected] wrote:
> > > I keep getting Error on line 31: Port mode is incompatible with
> > > declaration: A
> > >
> > > Same thing for B.
> > >
> > > This is line 31 that gives error: reg [15:0] A,B;
> > >
> > > Here is the code:
> > > ************************************************** **********************************
> > >
> > > module alu16(A,B,C,alu_code,overflow);
> > >
> > > /************************************************** **
> > > 16 bit arithmetic logic unit
> > >
> > > parameter:
> > > A.........16-bit A bidirectional
> > > B.........16-bit B input
> > > alu_code..5-bit operation to perform
> > > C.........16-bit bit result output
> > > overflow..overflow status (used for signed operations)
> > > ************************************************** **/
> > > inout [15:0] A;
> > > input [15:0] B;
> > > input [4:0] alu_code;
> > > output [15:0] C;
> > > output overflow;
> > >
> > > //internal nodes
> > >
> > > reg [15:0] A,B;
> > > reg [15:0] C;
> > > reg overflow;
> > >
> > > always @ (A or B or alu_code) begin
> > >
> > > //ARITHMETIC OPERATIONS
> > >
> > > if(alu_code[4:3] == 2'b00) begin
> > > case (alu_code[2:0])
> > > 3'b000:C = !((!A + 1) + (!B + 1) + 1); //signed 2's complement
> > > addition
> > > 3'b001:C = A + B;
> > > 3'b010:C = !((!A + 1) - (!B + 1) + 1); //signed 2's complement
> > > subtraction
> > > 3'b011:C = A - B;
> > > 3'b100:C = A + 1;
> > > 3'b101:C = A - 1;
> > > default:C = 8'bx;
> > > endcase
> > > overflow = C[15]^C[14];
> > > end
> > >
> > > //LOGIC OPERATIONS
> > >
> > > else if(alu_code[4:3] == 2'b01) begin
> > > case (alu_code[2:0])
> > > 3'b000:C = A && B;
> > > 3'b001:C = A || B;
> > > 3'b010:C = ((!A)&&(B) || (A)&&(!B));
> > > 3'b000:C = !A;
> > > default:C = 8'bx;
> > > endcase
> > > end
> > >
> > > //SHIFT OPERATIONS (<< >> are logical shifts, <<< >>> are arithmetic
> > > shifts in Verilog2001 and SystemVerilog)
> > >
> > > else if (alu_code[4:3] == 2'b10) begin
> > > case (alu_code[2:0])
> > > 3'b000:
> > > if(B[3:0] == 4'b0000) A = A << 0;
> > > else if(B[3:0] == 4'b0001) A = A << 1;
> > > else if(B[3:0] == 4'b0010) A = A << 2;
> > > else if(B[3:0] == 4'b0011) A = A << 3;
> > > else if(B[3:0] == 4'b0100) A = A << 4;
> > > else if(B[3:0] == 4'b0101) A = A << 5;
> > > else if(B[3:0] == 4'b0110) A = A << 6;
> > > else if(B[3:0] == 4'b0111) A = A << 7;
> > > else if(B[3:0] == 4'b1000) A = A << 8;
> > > else if(B[3:0] == 4'b1001) A = A << 9;
> > > else if(B[3:0] == 4'b1010) A = A << 10;
> > > else if(B[3:0] == 4'b1011) A = A << 11;
> > > else if(B[3:0] == 4'b1100) A = A << 12;
> > > else if(B[3:0] == 4'b1101) A = A << 13;
> > > else if(B[3:0] == 4'b1110) A = A << 14;
> > > else if(B[3:0] == 4'b1111) A = A << 15;
> > > 3'b001:
> > > if(B[3:0] == 4'b0000) A = A >> 0;
> > > else if(B[3:0] == 4'b0001) A = A >> 1;
> > > else if(B[3:0] == 4'b0010) A = A >> 2;
> > > else if(B[3:0] == 4'b0011) A = A >> 3;
> > > else if(B[3:0] == 4'b0100) A = A >> 4;
> > > else if(B[3:0] == 4'b0101) A = A >> 5;
> > > else if(B[3:0] == 4'b0110) A = A >> 6;
> > > else if(B[3:0] == 4'b0111) A = A >> 7;
> > > else if(B[3:0] == 4'b1000) A = A >> 8;
> > > else if(B[3:0] == 4'b1001) A = A >> 9;
> > > else if(B[3:0] == 4'b1010) A = A >> 10;
> > > else if(B[3:0] == 4'b1011) A = A >> 11;
> > > else if(B[3:0] == 4'b1100) A = A >> 12;
> > > else if(B[3:0] == 4'b1101) A = A >> 13;
> > > else if(B[3:0] == 4'b1110) A = A >> 14;
> > > else if(B[3:0] == 4'b1111) A = A >> 15;
> > > 3'b010:
> > > if(B[3:0] == 4'b0000) A = A <<< 0;
> > > else if(B[3:0] == 4'b0001) A = A <<< 1;
> > > else if(B[3:0] == 4'b0010) A = A <<< 2;
> > > else if(B[3:0] == 4'b0011) A = A <<< 3;
> > > else if(B[3:0] == 4'b0100) A = A <<< 4;
> > > else if(B[3:0] == 4'b0101) A = A <<< 5;
> > > else if(B[3:0] == 4'b0110) A = A <<< 6;
> > > else if(B[3:0] == 4'b0111) A = A <<< 7;
> > > else if(B[3:0] == 4'b1000) A = A <<< 8;
> > > else if(B[3:0] == 4'b1001) A = A <<< 9;
> > > else if(B[3:0] == 4'b1010) A = A <<< 10;
> > > else if(B[3:0] == 4'b1011) A = A <<< 11;
> > > else if(B[3:0] == 4'b1100) A = A <<< 12;
> > > else if(B[3:0] == 4'b1101) A = A <<< 13;
> > > else if(B[3:0] == 4'b1110) A = A <<< 14;
> > > else if(B[3:0] == 4'b1111) A = A <<< 15;
> > > 3'b000:
> > > if(B[3:0] == 4'b0000) A = A >>> 0;
> > > else if(B[3:0] == 4'b0001) A = A >>> 1;
> > > else if(B[3:0] == 4'b0010) A = A >>> 2;
> > > else if(B[3:0] == 4'b0011) A = A >>> 3;
> > > else if(B[3:0] == 4'b0100) A = A >>> 4;
> > > else if(B[3:0] == 4'b0101) A = A >>> 5;
> > > else if(B[3:0] == 4'b0110) A = A >>> 6;
> > > else if(B[3:0] == 4'b0111) A = A >>> 7;
> > > else if(B[3:0] == 4'b1000) A = A >>> 8;
> > > else if(B[3:0] == 4'b1001) A = A >>> 9;
> > > else if(B[3:0] == 4'b1010) A = A >>> 10;
> > > else if(B[3:0] == 4'b1011) A = A >>> 11;
> > > else if(B[3:0] == 4'b1100) A = A >>> 12;
> > > else if(B[3:0] == 4'b1101) A = A >>> 13;
> > > else if(B[3:0] == 4'b1110) A = A >>> 14;
> > > else if(B[3:0] == 4'b1111) A = A >>> 15;
> > > endcase
> > > end
> > > end
> > >
> > > //SET CONDITION OPERATIONS
> > > endmodule


Reply With Quote
  #6 (permalink)  
Old 10-19-2006, 08:44 AM
Mark McDougall
Guest
 
Posts: n/a
Default Re: Port mode is incompatible error

[email protected] wrote:

> Ok, I made the change( to make A an input and an internal wire, not
> register), but now it gives this error:
> ** Error: alu16.v(70): (vlog-2110) Illegal reference to net "A".
> For every line of code that tries to shift, for example:


Hint: you have to be explicit about *when* you drive the inout.

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make dual-port RAM from single port RAM? Frank @ CN Verilog 34 03-06-2006 12:33 PM
"port not found in module definition" compile error Junk0 Verilog 2 01-17-2005 04:36 PM
making output port to bi-directional port! Vick Verilog 0 12-16-2004 06:14 AM
Making output-port to bi-directional-port! Vick Verilog 5 12-15-2004 06:03 AM
$readmem warning : order incompatible kuldeep Verilog 4 09-17-2003 08:35 AM


All times are GMT +1. The time now is 05:12 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved