User`s manual
113 busy <= 1;
114 state <= state+1;
115 end
116
117 endmodule
A.1.10 flash manager.v
1 //manages all the stuff needed to read and write to the flash ROM
2 module flash_manager(
3 clock, reset,
4 dots,
5 writemode,
6 wdata,
7 dowrite,
8 raddr,
9 frdata,
10 doread,
11 busy,
12 flash_data,
13 flash_address,
14 flash_ce_b,
15 flash_oe_b,
16 flash_we_b,
17 flash_reset_b,
18 flash_sts,
19 flash_byte_b,
20 fsmstate);
21
22 input reset, clock; //clock and reset
23 output [639:0] dots; //outputs to dot-matrix to help debug flash, not necessary
24 input writemode; //if true then we’re in write mode, else we’re in read mode
25 input [15:0] wdata; //data to be written
26 input dowrite; //putting this high tells the manager the data it has is new, write it
27 input [22:0] raddr; //address to read from
28 output[15:0] frdata; //data being read
29 reg[15:0] rdata;
30 input doread; //putting this high tells the manager to perform a read on the current address
31 output busy; //and an output to tell folks we’re still working on the last thing
32 reg busy;
33
34 inout [15:0] flash_data; //direct passthrough from labkit to low-level modules (flash_int and test_fsm)
35 output [23:0] flash_address;
36 output flash_ce_b, flash_oe_b, flash_we_b;
37 output flash_reset_b, flash_byte_b;
38 input flash_sts;
70