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

Subversion Repositories versatile_library

[/] [versatile_library/] [trunk/] [rtl/] [verilog/] [io.v] - Diff between revs 44 and 45

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

Rev 44 Rev 45
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                     ////
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
 
`timescale 1ns/1ns
`ifdef O_DFF
`ifdef O_DFF
`define MODULE o_dff
`define MODULE o_dff
module `BASE`MODULE (d_i, o_pad, clk, rst);
module `BASE`MODULE (d_i, o_pad, clk, rst);
`undef MODULE
`undef MODULE
parameter width = 1;
parameter width = 1;
 
parameter reset_value = {width{1'b0}};
input [width-1:0]  d_i;
input [width-1:0]  d_i;
output [width-1:0] o_pad;
output [width-1:0] o_pad;
input clk, rst;
input clk, rst;
wire [width-1:0] d_i_int `SYN_KEEP;
wire [width-1:0] d_i_int `SYN_KEEP;
 
reg  [width-1:0] o_pad_int;
assign d_i_int = d_i;
assign d_i_int = d_i;
genvar i;
genvar i;
 
generate
for (i=0;i<width;i=i+1) begin
for (i=0;i<width;i=i+1) begin
    always @ (posedge clk or posedge rst)
    always @ (posedge clk or posedge rst)
    if (rst)
    if (rst)
        o_pad[i] <= 1'b0;
        o_pad_int[i] <= reset_value[i];
    else
    else
        o_pad[i] <= d_i_int[i];
        o_pad_int[i] <= d_i_int[i];
 
    assign #1 o_pad[i] = o_pad_int[i];
end
end
endgenerate
endgenerate
endmodule
endmodule
`endif
`endif
 
 
 
`timescale 1ns/1ns
`ifdef IO_DFF_OE
`ifdef IO_DFF_OE
`define MODULE io_dff_oe
`define MODULE io_dff_oe
module `BASE`MODULE ( d_i, d_o, oe, io_pad, clk, rst);
module `BASE`MODULE ( d_i, d_o, oe, io_pad, clk, rst);
`undef MODULE
`undef MODULE
parameter width = 1;
parameter width = 1;
Line 92... Line 97...
    always @ (posedge clk or posedge rst)
    always @ (posedge clk or posedge rst)
    if (rst)
    if (rst)
        d_i[i] <= 1'b0;
        d_i[i] <= 1'b0;
    else
    else
        d_i[i] <= io_pad[i];
        d_i[i] <= io_pad[i];
    assign io_pad[i] = (oe_q[i]) ? d_o_q[i] : 1'bz;
    assign #1 io_pad[i] = (oe_q[i]) ? d_o_q[i] : 1'bz;
end
end
endgenerate
endgenerate
endmodule
endmodule
`endif
`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.