OpenCores
URL https://opencores.org/ocsvn/versatile_library/versatile_library/trunk

Subversion Repositories versatile_library

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /versatile_library/trunk/rtl/verilog
    from Rev 148 to Rev 149
    Reverse comparison

Rev 148 → Rev 149

/versatile_library.v
7371,10 → 7371,14
output [31:0] dout;
 
parameter opcode_sll = 2'b00;
//parameter opcode_srl = 2'b01;
parameter opcode_srl = 2'b01;
parameter opcode_sra = 2'b10;
//parameter opcode_ror = 2'b11;
parameter opcode_ror = 2'b11;
 
parameter mult=0; // if set to 1 implemented based on multipliers which saves LUT
 
generate
if (mult==1) begin : impl_mult
wire sll, sra;
assign sll = opcode == opcode_sll;
assign sra = opcode == opcode_sra;
7444,6 → 7448,23
(s[4:3]==2'b01) ? tmp[1] :
(s[4:3]==2'b10) ? tmp[2] :
tmp[3];
end else begin : impl_classic
reg [31:0] dout;
`ifdef SYSTEMVERILOG
always_comb
`else
always @ (din or s or opcode)
`endif
case (opcode)
opcode_sll: dout = din << s;
opcode_srl: dout = din >> s;
opcode_sra: dout = (din >> s) | ({32,din[31]}} << (6'd32-{1'b0,s}}));
//opcode_ror: dout = not yet implemented
default: dout = din << s;
endcase
end
engenerate
 
endmodule
`endif
/versatile_library_actel.v
5105,9 → 5105,12
input [1:0] opcode;
output [31:0] dout;
parameter opcode_sll = 2'b00;
//parameter opcode_srl = 2'b01;
parameter opcode_srl = 2'b01;
parameter opcode_sra = 2'b10;
//parameter opcode_ror = 2'b11;
parameter opcode_ror = 2'b11;
parameter mult=0; // if set to 1 implemented based on multipliers which saves LUT
generate
if (mult==1) begin : impl_mult
wire sll, sra;
assign sll = opcode == opcode_sll;
assign sra = opcode == opcode_sra;
5168,6 → 5171,22
(s[4:3]==2'b01) ? tmp[1] :
(s[4:3]==2'b10) ? tmp[2] :
tmp[3];
end else begin : impl_classic
reg [31:0] dout;
`ifdef SYSTEMVERILOG
always_comb
`else
always @ (din or s or opcode)
`endif
case (opcode)
opcode_sll: dout = din << s;
opcode_srl: dout = din >> s;
opcode_sra: dout = (din >> s) | ({32,din[31]}} << (6'd32-{1'b0,s}}));
//opcode_ror: dout = not yet implemented
default: dout = din << s;
endcase
end
engenerate
endmodule
// logic unit
// supporting the following logic functions
/versatile_library_altera.v
5200,9 → 5200,12
input [1:0] opcode;
output [31:0] dout;
parameter opcode_sll = 2'b00;
//parameter opcode_srl = 2'b01;
parameter opcode_srl = 2'b01;
parameter opcode_sra = 2'b10;
//parameter opcode_ror = 2'b11;
parameter opcode_ror = 2'b11;
parameter mult=0; // if set to 1 implemented based on multipliers which saves LUT
generate
if (mult==1) begin : impl_mult
wire sll, sra;
assign sll = opcode == opcode_sll;
assign sra = opcode == opcode_sra;
5263,6 → 5266,22
(s[4:3]==2'b01) ? tmp[1] :
(s[4:3]==2'b10) ? tmp[2] :
tmp[3];
end else begin : impl_classic
reg [31:0] dout;
`ifdef SYSTEMVERILOG
always_comb
`else
always @ (din or s or opcode)
`endif
case (opcode)
opcode_sll: dout = din << s;
opcode_srl: dout = din >> s;
opcode_sra: dout = (din >> s) | ({32,din[31]}} << (6'd32-{1'b0,s}}));
//opcode_ror: dout = not yet implemented
default: dout = din << s;
endcase
end
engenerate
endmodule
// logic unit
// supporting the following logic functions
/arith.v
112,10 → 112,14
output [31:0] dout;
 
parameter opcode_sll = 2'b00;
//parameter opcode_srl = 2'b01;
parameter opcode_srl = 2'b01;
parameter opcode_sra = 2'b10;
//parameter opcode_ror = 2'b11;
parameter opcode_ror = 2'b11;
 
parameter mult=0; // if set to 1 implemented based on multipliers which saves LUT
 
generate
if (mult==1) begin : impl_mult
wire sll, sra;
assign sll = opcode == opcode_sll;
assign sra = opcode == opcode_sra;
185,6 → 189,23
(s[4:3]==2'b01) ? tmp[1] :
(s[4:3]==2'b10) ? tmp[2] :
tmp[3];
end else begin : impl_classic
reg [31:0] dout;
//E2_ifdef SYSTEMVERILOG
always_comb
//E2_else
always @ (din or s or opcode)
//E2_endif
case (opcode)
opcode_sll: dout = din << s;
opcode_srl: dout = din >> s;
opcode_sra: dout = (din >> s) | ({32,din[31]}} << (6'd32-{1'b0,s}}));
//opcode_ror: dout = not yet implemented
default: dout = din << s;
endcase
end
engenerate
 
endmodule
`endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.