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

Subversion Repositories rtf68ksys

[/] [rtf68ksys/] [trunk/] [rtl/] [verilog/] [EppStartAddress.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robfinch
module EppStartAddress(rst, clk, wr, ad, dbi, dbo, myad, trigger, startAddress);
2
input rst;
3
input clk;
4
input wr;
5
input [7:0] ad;
6
input [7:0] dbi;
7
output [7:0] dbo;
8
reg [7:0] dbo;
9
output myad;
10
output trigger;
11
output [47:0] startAddress;
12
reg [47:0] startAddress;
13
 
14
reg loadedBit;
15
assign trigger = loadedBit;
16
 
17
always @(posedge clk)
18
if (rst) begin
19
        loadedBit <= 1'b0;
20
        startAddress <= 48'd0;
21
end
22
else begin
23
        if (wr) begin
24
                case (ad)
25
                8'h80:  loadedBit <= |dbi;
26
                8'h81:  startAddress[ 7: 0] <= dbi;
27
                8'h82:  startAddress[15: 8] <= dbi;
28
                8'h83:  startAddress[23:16] <= dbi;
29
                8'h84:  startAddress[31:24] <= dbi;
30
                8'h85:  startAddress[39:32] <= dbi;
31
                8'h86:  startAddress[47:40] <= dbi;
32
                endcase
33
        end
34
end
35
 
36
wire myad =
37
        ad==8'h80 ||
38
        ad==8'h81 ||
39
        ad==8'h82 ||
40
        ad==8'h83 ||
41
        ad==8'h84 ||
42
        ad==8'h85 ||
43
        ad==8'h86
44
        ;
45
always @(ad or loadedBit or startAddress)
46
        case (ad)
47
        8'h80:  dbo <= {8{loadedBit}};
48
        8'h81:  dbo <= startAddress[7:0];
49
        8'h82:  dbo <= startAddress[15:8];
50
        8'h83:  dbo <= startAddress[23:16];
51
        8'h84:  dbo <= startAddress[31:24];
52
        8'h85:  dbo <= startAddress[39:32];
53
        8'h86:  dbo <= startAddress[47:40];
54
        default:        dbo <= 8'h00;
55
        endcase
56
 
57
endmodule
58
 

powered by: WebSVN 2.1.0

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