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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1k_startup/] [rtl/] [verilog/] [OR1K_startup_ACTEL.v] - Blame information for rev 611

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 marcus.erl
module OR1K_startup
2
  (
3
    input [6:2]       wb_adr_i,
4
    input             wb_stb_i,
5
    input             wb_cyc_i,
6
    output reg [31:0] wb_dat_o,
7
    output reg        wb_ack_o,
8
    input             wb_clk,
9
    input             wb_rst
10
   );
11
 
12
   reg [3:0]           counter;
13
   wire [7:0]          do;
14
 
15
   parameter [31:0] NOP = 32'h15000000;
16
 
17
   always @ (posedge wb_clk or posedge wb_rst)
18
     if (wb_rst)
19
       counter <= 4'd0;
20
     else
21
       if (!wb_cyc_i)
22
         counter <= 4'd0;
23
       else if (wb_cyc_i & wb_stb_i & !wb_ack_o)
24
         counter <= counter + 4'd1;
25
 
26
   always @ (posedge wb_clk or posedge wb_rst)
27
     if (wb_rst)
28
       wb_ack_o <= 1'b0;
29
     else
30
       wb_ack_o <= (counter == 4'd15);
31
 
32
   always @ (posedge wb_clk or posedge wb_rst)
33
     if (wb_rst)
34
       wb_dat_o <= NOP;
35
     else
36
       case (counter)
37
         4'd15: wb_dat_o[31:24] <= do;
38
         4'd11: wb_dat_o[23:16] <= do;
39
         4'd7 : wb_dat_o[15: 8] <= do;
40
         4'd3 : wb_dat_o[ 7: 0] <= do;
41
       endcase
42
 
43
   flash flash0
44
     (
45
      .CLK  (counter[1] ^ counter[0]),
46
      .ADDR ({wb_adr_i,counter[3:2]}),
47
      .DOUT (do)
48
      );
49
 
50
endmodule // OR1K_startup

powered by: WebSVN 2.1.0

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