Virtual sequence

hi
in virtual seq
i have tx seq and rx seq in fork join .

i initiate the RX sequence when the TX sequence starts sending data and the data becomes available in the RX FIFO, signaling the RX available (output) to go high. At this point, the RX packet should be enabled to send (RX enable input).

Approach: I plan to create an event object in the virtual sequence. During the run phase, after executing the TX sequence, I’ll wait for this event to trigger. In the RX driver’s run phase, the event will be triggered when the RX available signal goes high, at which point the RX enable will be sent.

Could you please review my approach and confirm if it’s appropriate for this scenario? Any insights or suggestions for improvement would be greatly appreciated.

You need to explain more about what you are trying to accomplish? Why do you need to wait for data to become available prior to starting your RX sequence? Does the RX BFM wait for the rx_available signal to be asserted and then start sampling data? If so, you can start the sequence at time 0 and the BFM will wait for data to be available.

For sending a complete Ethernet frame, the data must be transmitted multiple times (eight times in this scenario) through the pkt_tx interface, accompanied by necessary control signals. This includes setting signals such as pkt_tx_val for valid data, pkt_tx_sop for the start of the packet, and pkt_tx_eop for the end of the packet.

The reception process involves the pkt_rx interface, which is primarily controlled by the rx_en signal. The rx_avail will be high when the transmitted data has successfully passed through both the XGMII TX and RX paths. then we have send pkt_rx .I am implementing a loopback from XGMII TX to RX to ensure the data transmitted is the same as the data received.

copy paste is working so sharing pics
virtual seq:
fork
both packet seq are starting

join
NIow in rx_driver after 160 clock cycles i am sending rx_en .as we see in picture avail is getting low even threough thery are few data still need to read



so how to i make it rx_seq to start when rx_avail is high ?

Your best approach is to use an autonomous rx driver which captures every packet and sends it out of an analysis port. You can also send a sequence item to the driver to get the last received packet if needed by the sequence.

You can do the loopback comparison in the scoreboard.

task rx_packet;
  packet_t pkt;
  int count;
  vi.pkt_rx_ren = 1'b0;
  forever begin
    while (vi.pkt_rx_avail == 1'b0) @(posedge vi.clk_156m25);
    vi.pkt_rx_ren = 1'b1;
    count = 0;
    while (vi.pkt_rx_eop == 1'b0) begin
      pkt.data[count++] = pkt_rx_data;
      @(posedge vi.clk_156m25);
    end
    pkt.data[count] = pkt_rx_data;
    ap.write(pkt);
  end
endtask