
3.3. A SIMPLE COMPUTER
33
Control
Unit
Control
Unit
>=1 tx
S
R
send
R
S
reg
rx_full F/F
wr
tx
tx_empty F/F
shift
Shift
Reg
rd
in
&
&
wb.stb
wb.stb
wb.we
wb.sel[3]
wb.dat_i[22:21]
wb.ack
wb.sel[3]
wb.we
wb.stb
wb.dat_i[16]
wb.adr[2]
wb.adr[2]
end_char_tx
end_char_rx
wb.dat_o[31:24]
wb.dat_i[31:24]
rx
shift_rx
load_tx
shift_tx
shift
load
Reg
Shift
out
load
reg
rx
load
Figure 3.4: A sketch of the Wishbone interface for the UART. The signal load_tx is
a single-pulsed version of send. The tx_empty F/F is connected to two wires.
• tx_empty, set when the stop-bit has been transmitted and reset when the trans-
mit register is written. The 16550 has two slightly diff erent flags for this case.
The monitor will work if you connect tx_empty to both these flags.
Figure 3.5 shows address maps for the UART connected to an 8 bit bus and a 32 bit
bus. The transmit register should be placed on wb.dat_o[31:24], the receive register
on wb.dat_i[31:24]. The status register should be placed on wb.dat_i[23:16].
What about address decoding? The 8 most significant bits are already decoded in the
wb.stb-signal. Since we are now using a 32 bit data bus, we will not use the two
least significant address bits. Instead the wb.sel-signal is used to access individual
data bytes. For instance wb.sel[3] is asserted when a byte on address 0x9000_0000
or (for instance) 0x9000_0004 is accessed. To prevent an access to 0x9000_0004 to
reset the status F/Fs, we connect wb.adr[2] to the AND gates.
Preparation task 2
Why must the
wb.sel[3]
-signal be included in the reset condition for the
rx_full
F/F?
The code for the lab skeleton lab1_uart_top.sv is given in the listing 3.1. The
Kommentare zu diesen Handbüchern