From afc38abe082e69ed2e88e50b1c686ef05e4a7f03 Mon Sep 17 00:00:00 2001 From: bbracker Date: Thu, 21 Apr 2022 10:31:16 -0700 Subject: [PATCH] change how tristate I/O is spoofed in GPIO loopback test --- pipelined/src/uncore/gpio.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipelined/src/uncore/gpio.sv b/pipelined/src/uncore/gpio.sv index ad82e62aa..a70b44db4 100644 --- a/pipelined/src/uncore/gpio.sv +++ b/pipelined/src/uncore/gpio.sv @@ -146,8 +146,8 @@ module gpio ( // chip i/o // connect OUT to IN for loopback testing - if (`GPIO_LOOPBACK_TEST) assign input0d = GPIOPinsOut & output_en | (GPIOPinsIn & input_en); - else assign input0d = GPIOPinsIn & input_en; + if (`GPIO_LOOPBACK_TEST) assign input0d = ((output_en & GPIOPinsOut) | (~output_en & GPIOPinsIn)) & input_en; + else assign input0d = GPIOPinsIn & input_en; flop #(32) sync1(HCLK,input0d,input1d); flop #(32) sync2(HCLK,input1d,input2d); flop #(32) sync3(HCLK,input2d,input3d);