Skip to content

Commit 8b9ef91

Browse files
committed
configs,dev: reduce UARTLite console PIO latency
Change-Id: I066e3c04be47b2f20da2e3601c6476bfb4292d82
1 parent 12cef0c commit 8b9ef91

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

configs/common/FSConfig.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,10 @@ def makeXiangshanPlatformSystem(mem_mode, mdesc=None, np=1, ruby=False):
682682
self.bridge.cpu_side_port = self.membus.mem_side_ports
683683

684684
self.uartlite = UartLite()
685+
# Keep debug console output from dominating short bare-metal runs.
686+
# We do not study UART timing here, so prefer a near-functional UART for
687+
# printf-heavy debug/program output.
688+
self.uartlite.pio_latency = '1ns'
685689
self.uartlite.pio = self.iobus.mem_side_ports
686690

687691
self.lint = Clint()

src/dev/serial/Uart.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,3 @@ class UartLite(BasicPioDevice):
8888
cxx_class = 'gem5::UartLite'
8989
pio_addr = 0x40600000
9090
pio_size = Param.Addr(0xd, "Size of address range")
91-
tx_pio_latency = Param.Latency('1ns', "Latency for UART TX FIFO writes")

src/dev/serial/uartlite.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,21 @@ Tick UartLite::write(PacketPtr pkt)
2727
auto offset = pkt->getAddr() - pioAddr;
2828
assert(pkt->getSize() == 1);
2929

30-
Tick delay = pioDelay;
31-
3230
switch (offset) {
3331
case UARTLITE_TX_FIFO:
3432
putc(pkt->getRaw<uint8_t>(), stdout);
35-
delay = txPioDelay;
3633
break;
3734
default:
3835
warn("Write to other uartlite addr %i is not implemented\n",
3936
offset);
4037
}
4138

4239
pkt->makeAtomicResponse();
43-
return delay;
40+
return pioDelay;
4441
}
4542

4643
UartLite::UartLite(const UartLiteParams *params)
47-
: BasicPioDevice(*params, params->pio_size),
48-
txPioDelay(params->tx_pio_latency)
44+
: BasicPioDevice(*params, params->pio_size)
4945
{
5046
}
5147

src/dev/serial/uartlite.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ namespace gem5
1414
{
1515
class UartLite : public BasicPioDevice
1616
{
17-
private:
18-
Tick txPioDelay;
19-
2017
public:
2118
Tick read(PacketPtr pkt) override;
2219
Tick write(PacketPtr pkt) override;

0 commit comments

Comments
 (0)