Question: Computer Science Verilog Provide the complete code including the generator, the receiver and a testbench please! Please make sure it works before submitting your answer!

Computer Science Verilog
Provide the complete code including the generator, the receiver and a testbench please! Please make sure it works before submitting your answer!
Design of an I2C transaction generator and receiver
Design an I2C transaction generator according to the specifications in the document I2C-bus Specification and User Manual, revision 7.0.
Interfaces of the Generator:
a) CLK This is an input that comes from the CPU with a certain frequency. The active edge is the rising edge.
b) RESET Input to reset the generator. If RESET=1, the generator works normally. Otherwise, the generator returns to its initial state and all outputs go to zero.
c) START_STB A one-clock cycle strobe pulse indicating that the CPU wants to initiate an I2C transaction.
d) RNW Read not write. This signal indicates the direction of the transaction the CPU wants to execute. When RNW=1, it is a read transaction; when RNW=0, it is a write transaction.
e) I2C_ADDR[6:0] This input comes from a CPU register and contains the address of the I2C transaction receiver.
f) SCL I2C clock output. The active edge of the SCL signal is the rising edge. The generator must generate SCL at 25% of the input CLK frequency.
g) SDA_OUT Serial data output. Must behave according to the I2C protocol for START, STOP, and read/write transactions.
h) SDA_OE Enable signal for SDA_OUT. Set to 1 when the generator controls the I2C bus, and 0 when the receiver controls it, according to protocol specifications.
i) SDA_IN Serial input from the tester. Must behave as per the I2C protocol for ACK signals and providing input data during read transactions.
j) WR_DATA[15:0] Parallel input containing the 16 bits to be sent through I2C during a write transaction.
k) RD_DATA[15:0] Output producing the 16 bits received from the I2C transaction receiver during a read transaction on SDA_IN. After receiving the 16 bits, the generator must send a STOP condition per the I2C protocol.
Receiver Interfaces:
l) CLK Input clock from the CPU with a rising active edge.
m) RESET Resets the receiver. If RESET=1, the receiver operates normally. Otherwise, it resets to the initial state.
n) I2C_ADDR[6:0] Input address to verify that the received transaction matches the receivers address.
o) SCL Input clock for I2C. The active edge is the rising edge.
p) SDA_OUT Serial output that must follow I2C protocol for START, STOP, and read/write transactions.
q) SDA_OE Enable signal for SDA_OUT during certain parts of the transaction.
r) SDA_IN Serial input sent from the receiver to the generator, used for ACK and providing data during reads.
s) WR_DATA[15:0] Parallel output containing the 16 bits received via I2C during a write transaction.
t) RD_DATA[15:0] Parallel input providing the 16 bits to be sent during a read transaction through SDA_IN.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!