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

Subversion Repositories versatile_library

[/] [versatile_library/] [trunk/] [rtl/] [verilog/] [logic.v] - Diff between revs 38 and 40

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 38 Rev 40
Line 37... Line 37...
//// You should have received a copy of the GNU Lesser General    ////
//// You should have received a copy of the GNU Lesser General    ////
//// Public License along with this source; if not, download it   ////
//// Public License along with this source; if not, download it   ////
//// from http://www.opencores.org/lgpl.shtml                     ////
//// from http://www.opencores.org/lgpl.shtml                     ////
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
module vl_mux_andor ( a, sel, dout);
`ifdef MUX_ANDOR
 
`define MODULE mux_andor
 
module `BASE`MODULE ( a, sel, dout);
 
`undef MODULE
 
 
parameter width = 32;
parameter width = 32;
parameter nr_of_ports = 4;
parameter nr_of_ports = 4;
 
 
input [nr_of_ports*width-1:0] a;
input [nr_of_ports*width-1:0] a;
Line 57... Line 60...
        for (j=0;j<32;j=j+1)
        for (j=0;j<32;j=j+1)
            dout[j] = (a[(i-1)*width + j] & sel[i]) | dout[j];
            dout[j] = (a[(i-1)*width + j] & sel[i]) | dout[j];
end
end
 
 
endmodule
endmodule
 
`endif
 
 
module vl_mux2_andor ( a1, a0, sel, dout);
`ifdef MUX2_ANDOR
 
`define MODULE mux2_andor
 
module `BASE`MODULE ( a1, a0, sel, dout);
 
`undef MODULE
 
 
parameter width = 32;
parameter width = 32;
localparam nr_of_ports = 2;
localparam nr_of_ports = 2;
input [width-1:0] a1, a0;
input [width-1:0] a1, a0;
input [nr_of_ports-1:0] sel;
input [nr_of_ports-1:0] sel;
output [width-1:0] dout;
output [width-1:0] dout;
 
 
vl_mux_andor
`define MODULE mux_andor
 
`BASE`MODULE
    # ( .width(width), .nr_of_ports(nr_of_ports))
    # ( .width(width), .nr_of_ports(nr_of_ports))
    mux0( .a({a1,a0}), .sel(sel), .dout(dout));
    mux0( .a({a1,a0}), .sel(sel), .dout(dout));
 
`undef MODULE
 
 
endmodule
endmodule
 
`endif
 
 
module vl_mux3_andor ( a2, a1, a0, sel, dout);
`ifdef MUX3_ANDOR
 
`define MODULE mux3_andor
 
module `BASE`MODULE ( a2, a1, a0, sel, dout);
 
`undef MODULE
 
 
parameter width = 32;
parameter width = 32;
localparam nr_of_ports = 3;
localparam nr_of_ports = 3;
input [width-1:0] a2, a1, a0;
input [width-1:0] a2, a1, a0;
input [nr_of_ports-1:0] sel;
input [nr_of_ports-1:0] sel;
output [width-1:0] dout;
output [width-1:0] dout;
 
 
vl_mux_andor
`define MODULE mux_andor
 
`BASE`MODULE
    # ( .width(width), .nr_of_ports(nr_of_ports))
    # ( .width(width), .nr_of_ports(nr_of_ports))
    mux0( .a({a2,a1,a0}), .sel(sel), .dout(dout));
    mux0( .a({a2,a1,a0}), .sel(sel), .dout(dout));
 
`undef MODULE
endmodule
endmodule
 
`endif
 
 
module vl_mux4_andor ( a3, a2, a1, a0, sel, dout);
`ifdef MUX4_ANDOR
 
`define MODULE mux4_andor
 
module `BASE`MODULE ( a3, a2, a1, a0, sel, dout);
 
`undef MODULE
 
 
parameter width = 32;
parameter width = 32;
localparam nr_of_ports = 4;
localparam nr_of_ports = 4;
input [width-1:0] a3, a2, a1, a0;
input [width-1:0] a3, a2, a1, a0;
input [nr_of_ports-1:0] sel;
input [nr_of_ports-1:0] sel;
output [width-1:0] dout;
output [width-1:0] dout;
 
 
vl_mux_andor
`define MODULE mux_andor
 
`BASE`MODULE
    # ( .width(width), .nr_of_ports(nr_of_ports))
    # ( .width(width), .nr_of_ports(nr_of_ports))
    mux0( .a({a3,a2,a1,a0}), .sel(sel), .dout(dout));
    mux0( .a({a3,a2,a1,a0}), .sel(sel), .dout(dout));
 
`undef MODULE
 
 
endmodule
endmodule
 
`endif
 
 
module vl_mux5_andor ( a4, a3, a2, a1, a0, sel, dout);
`ifdef MUX5_ANDOR
 
`define MODULE mux5_andor
 
module `BASE`MODULE ( a4, a3, a2, a1, a0, sel, dout);
 
`undef MODULE
 
 
parameter width = 32;
parameter width = 32;
localparam nr_of_ports = 5;
localparam nr_of_ports = 5;
input [width-1:0] a4, a3, a2, a1, a0;
input [width-1:0] a4, a3, a2, a1, a0;
input [nr_of_ports-1:0] sel;
input [nr_of_ports-1:0] sel;
output [width-1:0] dout;
output [width-1:0] dout;
 
 
vl_mux_andor
`define MODULE mux_andor
 
`BASE`MODULE
    # ( .width(width), .nr_of_ports(nr_of_ports))
    # ( .width(width), .nr_of_ports(nr_of_ports))
    mux0( .a({a4,a3,a2,a1,a0}), .sel(sel), .dout(dout));
    mux0( .a({a4,a3,a2,a1,a0}), .sel(sel), .dout(dout));
 
`undef MODULE
 
 
endmodule
endmodule
 
`endif
 
 
module vl_mux6_andor ( a5, a4, a3, a2, a1, a0, sel, dout);
`ifdef MUX6_ANDOR
 
`define MODULE mux6_andor
 
module `BASE`MODULE ( a5, a4, a3, a2, a1, a0, sel, dout);
 
`undef MODULE
 
 
parameter width = 32;
parameter width = 32;
localparam nr_of_ports = 6;
localparam nr_of_ports = 6;
input [width-1:0] a5, a4, a3, a2, a1, a0;
input [width-1:0] a5, a4, a3, a2, a1, a0;
input [nr_of_ports-1:0] sel;
input [nr_of_ports-1:0] sel;
output [width-1:0] dout;
output [width-1:0] dout;
 
 
vl_mux_andor
`define MODULE mux_andor
 
`BASE`MODULE
    # ( .width(width), .nr_of_ports(nr_of_ports))
    # ( .width(width), .nr_of_ports(nr_of_ports))
    mux0( .a({a5,a4,a3,a2,a1,a0}), .sel(sel), .dout(dout));
    mux0( .a({a5,a4,a3,a2,a1,a0}), .sel(sel), .dout(dout));
 
`undef MODULE
 
 
endmodule
endmodule
 
`endif
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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