As you might expect, there are several ways to implement this depending on the speeds you need to achieve.
The most direct (easiest and lowest speed) would be something like this:
- Use a WireIn to relay the address/outgoing data register.
- Use a WireOut to relay the incoming data register.
- Use a TriggerIn to relay the write/read strobe.
From the PC, a transaction sequence would be something like this (pseudocode):
–Perform a WRITE:
–Perform a READ:
datain = GetWireInValue(DATAIN)
This provides a really easy way to do what (I think) you want without using much internal logic. But it is slow due to the many transactions required.
An alternative would be to setup a block RAM with a bunch of data to be read/written with some sort of structure to control a state machine. You could use a PipeIn to load that block RAM with transactions, then use a TriggerIn to start processing those transactions. Then, use a PipeOut to read the results (if any). I’ve used this technique to perform I2C transactions.