T
Taha
Guest
Dear all,
Can someone help me rewrite the segment of code below in order to make
the code read like a real HDL segment as opposed to a netlist whilst
still being able to compile into a maximum of 34 muxes per partial
product row. (i.e. I really dont belive that I should have to write out
the equation for each bit when I use an HDL, or else, whats the
advantage of HDL over schematic capture )
In addition, since I will need 8 rows of partial products, do i have to
create 8 instances of ppRow or can I use a for loop to put the data
into some sort of a matrix.
Please do note that this should be combinational logic only ... no
clocks/sequential ...
One more thing, if someone can be kind enough to send me a short
tutorial on how to use the Cadence IC tools (i.e. NC-Verilog, Encounter
RTL compiler, Virtuoso Schematic, Analog artist, Virtuoso Layout) to go
through a top - down design, i would really be grateful.
Sincerely,
Taha Amiralli
/**
* Partial Product Row
* Input: a - 16 bit Multiplicand
* sign - 1 bit from MBE
* shift - 1 bit from MBE
* pass - 1 bit from MBE
* Output: ppRow - 16 bit Partial product row given the sign, shift and
pass bits form the MBE stage
*/
module ppRow(a, sign, shift, pass, ppRow);
/* Inputs */
input [15:0]a;
input sign, shift, pass;
/* Outputs */
output [15:0]ppRow;
/* Datatypes */
integer i;
wire tmp;
/* RTL */
/// Partial Product row generation
assign ppRow[15] = (pass) ? ((sign)?a[15]:~a[15]) :
((sign)?a[15-1]:~a[15-1]);
assign ppRow[14] = (pass) ? ((sign)?a[14]:~a[14]) :
((sign)?a[14-1]:~a[14-1]);
assign ppRow[13] = (pass) ? ((sign)?a[13]:~a[13]) :
((sign)?a[13-1]:~a[13-1]);
assign ppRow[12] = (pass) ? ((sign)?a[12]:~a[12]) :
((sign)?a[12-1]:~a[12-1]);
assign ppRow[11] = (pass) ? ((sign)?a[11]:~a[11]) :
((sign)?a[11-1]:~a[11-1]);
assign ppRow[10] = (pass) ? ((sign)?a[10]:~a[10]) :
((sign)?a[10-1]:~a[10-1]);
assign ppRow[9] = (pass) ? ((sign)?a[9]:~a[9]) :
((sign)?a[9-1]:~a[9-1]);
assign ppRow[8] = (pass) ? ((sign)?a[8]:~a[8]) :
((sign)?a[8-1]:~a[8-1]);
assign ppRow[7] = (pass) ? ((sign)?a[7]:~a[7]) :
((sign)?a[7-1]:~a[7-1]);
assign ppRow[6] = (pass) ? ((sign)?a[6]:~a[6]) :
((sign)?a[6-1]:~a[6-1]);
assign ppRow[5] = (pass) ? ((sign)?a[5]:~a[5]) :
((sign)?a[5-1]:~a[5-1]);
assign ppRow[4] = (pass) ? ((sign)?a[4]:~a[4]) :
((sign)?a[4-1]:~a[4-1]);
assign ppRow[3] = (pass) ? ((sign)?a[3]:~a[3]) :
((sign)?a[3-1]:~a[3-1]);
assign ppRow[2] = (pass) ? ((sign)?a[2]:~a[2]) :
((sign)?a[2-1]:~a[2-1]);
assign ppRow[1] = (pass) ? ((sign)?a[1]:~a[1]) :
((sign)?a[1-1]:~a[1-1]);
assign ppRow[0] = (pass) ? ((sign)?a[0]:~a[0]) : 1'b0;
endmodule
Can someone help me rewrite the segment of code below in order to make
the code read like a real HDL segment as opposed to a netlist whilst
still being able to compile into a maximum of 34 muxes per partial
product row. (i.e. I really dont belive that I should have to write out
the equation for each bit when I use an HDL, or else, whats the
advantage of HDL over schematic capture )
In addition, since I will need 8 rows of partial products, do i have to
create 8 instances of ppRow or can I use a for loop to put the data
into some sort of a matrix.
Please do note that this should be combinational logic only ... no
clocks/sequential ...
One more thing, if someone can be kind enough to send me a short
tutorial on how to use the Cadence IC tools (i.e. NC-Verilog, Encounter
RTL compiler, Virtuoso Schematic, Analog artist, Virtuoso Layout) to go
through a top - down design, i would really be grateful.
Sincerely,
Taha Amiralli
/**
* Partial Product Row
* Input: a - 16 bit Multiplicand
* sign - 1 bit from MBE
* shift - 1 bit from MBE
* pass - 1 bit from MBE
* Output: ppRow - 16 bit Partial product row given the sign, shift and
pass bits form the MBE stage
*/
module ppRow(a, sign, shift, pass, ppRow);
/* Inputs */
input [15:0]a;
input sign, shift, pass;
/* Outputs */
output [15:0]ppRow;
/* Datatypes */
integer i;
wire tmp;
/* RTL */
/// Partial Product row generation
assign ppRow[15] = (pass) ? ((sign)?a[15]:~a[15]) :
((sign)?a[15-1]:~a[15-1]);
assign ppRow[14] = (pass) ? ((sign)?a[14]:~a[14]) :
((sign)?a[14-1]:~a[14-1]);
assign ppRow[13] = (pass) ? ((sign)?a[13]:~a[13]) :
((sign)?a[13-1]:~a[13-1]);
assign ppRow[12] = (pass) ? ((sign)?a[12]:~a[12]) :
((sign)?a[12-1]:~a[12-1]);
assign ppRow[11] = (pass) ? ((sign)?a[11]:~a[11]) :
((sign)?a[11-1]:~a[11-1]);
assign ppRow[10] = (pass) ? ((sign)?a[10]:~a[10]) :
((sign)?a[10-1]:~a[10-1]);
assign ppRow[9] = (pass) ? ((sign)?a[9]:~a[9]) :
((sign)?a[9-1]:~a[9-1]);
assign ppRow[8] = (pass) ? ((sign)?a[8]:~a[8]) :
((sign)?a[8-1]:~a[8-1]);
assign ppRow[7] = (pass) ? ((sign)?a[7]:~a[7]) :
((sign)?a[7-1]:~a[7-1]);
assign ppRow[6] = (pass) ? ((sign)?a[6]:~a[6]) :
((sign)?a[6-1]:~a[6-1]);
assign ppRow[5] = (pass) ? ((sign)?a[5]:~a[5]) :
((sign)?a[5-1]:~a[5-1]);
assign ppRow[4] = (pass) ? ((sign)?a[4]:~a[4]) :
((sign)?a[4-1]:~a[4-1]);
assign ppRow[3] = (pass) ? ((sign)?a[3]:~a[3]) :
((sign)?a[3-1]:~a[3-1]);
assign ppRow[2] = (pass) ? ((sign)?a[2]:~a[2]) :
((sign)?a[2-1]:~a[2-1]);
assign ppRow[1] = (pass) ? ((sign)?a[1]:~a[1]) :
((sign)?a[1-1]:~a[1-1]);
assign ppRow[0] = (pass) ? ((sign)?a[0]:~a[0]) : 1'b0;
endmodule