OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [cpu/] [bus/] [data_pins_lattice.v] - Blame information for rev 17

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 gdevic
// Use this file with Lattice toolset instead of data_pins.v
2
//
3 17 gdevic
// This file is provided courtesy by JuanS
4 13 gdevic
 
5
module data_pins(
6
    bus_db_pin_oe,
7
    bus_db_pin_re,
8
    ctl_bus_db_we,
9
    clk,
10
    ctl_bus_db_oe,
11
    D,
12
    db
13
);
14
 
15
input wire bus_db_pin_oe;
16
input wire bus_db_pin_re;
17
input wire ctl_bus_db_we;
18
input wire clk;
19
input wire ctl_bus_db_oe;
20
inout wire [7:0] D;
21
inout wire [7:0] db;
22
 
23
reg [7:0] dout;
24
 
25
always@(negedge clk)
26
begin
27
    if (ctl_bus_db_we | bus_db_pin_re)
28
    begin
29
        if (bus_db_pin_re)
30
        dout <= D;
31
    else if (ctl_bus_db_we)
32
        dout <= db;
33
    end
34
end
35
 
36
assign db = ctl_bus_db_oe ? dout : 8'hZ;
37
assign D = bus_db_pin_oe ? dout : 8'hZ;
38
 
39
endmodule

powered by: WebSVN 2.1.0

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