Hi everyone, i was tryin g to understand whats ha...
# caravel
b
Hi everyone, i was tryin g to understand whats happening in the hkspi_tb, - in that one thing that i observed was the oeb keeps toggeling i.e the SDO pin keeps togelling - what is the purpose? but also in the RTL it mentions that the pin is used only for output - then why toggle the oen for it ? what is the exact purpose of the pin - SDO pin[1] please do help me understand it
1
t
The purpose of the
hkspi
testbench is to exercise the housekeeping SPI, which is an SPI slave module, so CSB, SCK, and SDI are inputs to the SPI, and SDO is the output. The testbench defines sequences of commands it sends to the SPI to check the function, such as:
Copy code
start_csb();
            write_byte(8'h40);  // Read stream command
            write_byte(8'h03);  // Address (register 3 = product ID)
            read_byte(tbdata);
            end_csb();
            #10;
            $display("Read data = 0x%02x (should be 0x11)", tbdata);
So the testbench applies signals to the chip asking the SPI slave to provide the data at SPI register address 3 (which is the product ID). The SPI responds by clocking out the contents of register 3 on SDO, which is why you should see SDO toggling. Having an output enable on an SDO line is a typical feature of SPI slaves that allows multiple slaves to be connected together on the same SDO line. Only the slave with CSB asserted can control the common SDO line.
b
Here, when you are saying the slave having control.over the SDO pin as in? Won't it cause a multi driver - and it is a output pin But in the hkspi_tb, the oen keeps toggling, what does that imply?
@Tim Edwards anything on this?
t
I answered the question and I don't understand what you're still confused about.