Rearranged uart_logger block to only generate if UART is supported

This commit is contained in:
slmnemo 2024-04-12 21:30:33 -07:00
parent 90040a6a21
commit 342c99d6ea

View File

@ -580,12 +580,14 @@ module testbench;
end
// Append UART output to file for tests
always @(posedge clk) begin
if (P.UART_SUPPORTED & TEST == "buildroot") begin
if (~dut.uncore.uncore.uart.uart.MEMWb & dut.uncore.uncore.uart.uart.u.A == 3'b000 & ~dut.uncore.uncore.uart.uart.u.DLAB) begin
memFile = $fopen(uartoutfilename, "ab");
$fwrite(memFile, "%c", dut.uncore.uncore.uart.uart.u.Din);
$fclose(memFile);
if (P.UART_SUPPORTED) begin: uart_logger
always @(posedge clk) begin
if (TEST == "buildroot") begin
if (~dut.uncore.uncore.uart.uart.MEMWb & dut.uncore.uncore.uart.uart.u.A == 3'b000 & ~dut.uncore.uncore.uart.uart.u.DLAB) begin
memFile = $fopen(uartoutfilename, "ab");
$fwrite(memFile, "%c", dut.uncore.uncore.uart.uart.u.Din);
$fclose(memFile);
end
end
end
end