mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-30 02:32:53 +08:00
Adding asic cell to buffer
-Note that asic cells should not be vectorized -Simplifies implementation (per target)
This commit is contained in:
parent
edaa41dac7
commit
10421758bc
@ -2,23 +2,28 @@
|
||||
//# Function: Buffer #
|
||||
//#############################################################################
|
||||
//# Author: Andreas Olofsson #
|
||||
//# License: MIT (see LICENSE file in OH! repository) #
|
||||
//# License: MIT (see LICENSE file in OH! repository) #
|
||||
//#############################################################################
|
||||
|
||||
module oh_buffer #(parameter N = 1, // number of inputs
|
||||
parameter SIZE = 1) // size of buffer
|
||||
( input [N-1:0] in, // input
|
||||
module oh_buffer
|
||||
#(parameter N = 1, // vector width
|
||||
parameter SYN = "TRUE", // synthesize buffer
|
||||
parameter TYPE = "DEFAULT") // buffer type
|
||||
(
|
||||
input [N-1:0] in, // input
|
||||
output [N-1:0] out // output
|
||||
);
|
||||
|
||||
`ifdef CFG_ASIC
|
||||
asic_buf #(.SIZE(SIZE)) ibuf [N-1:0] (.in(in[N-1:0]),
|
||||
.out(out[N-1:0]));
|
||||
`else
|
||||
assign out[N-1:0] = in[N-1:0];
|
||||
`endif
|
||||
|
||||
);
|
||||
generate
|
||||
if(SYN == "TRUE") begin
|
||||
assign out[N-1:0] = in[N-1:0];
|
||||
end
|
||||
else begin
|
||||
genvar i;
|
||||
for (i=0;i<N;i=i+1) begin
|
||||
asic_buffer #(.TYPE(TYPE))
|
||||
asic_buffer (.out (out[N-1:0]),
|
||||
.in (in[N-1:0]));
|
||||
end
|
||||
end
|
||||
endgenerate
|
||||
endmodule // oh_buffer
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user