+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Junior Member level 3
    Points: 141, Level: 1

    Join Date
    Jul 2019
    Posts
    29
    Helped
    0 / 0
    Points
    141
    Level
    1

    CRC Error insertion and detection

    Hello,

    I have the auto generated CRC parallel verilog code for muti-bit data stream. I even wrote a testbench to check the CRC. Now I want to write a testbench that injects random errors and detects it. How can i do that in verilog?

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 5
    Points: 8,433, Level: 21

    Join Date
    Apr 2016
    Posts
    1,771
    Helped
    312 / 312
    Points
    8,433
    Level
    21

    Re: CRC Error insertion and detection

    you can use the force command in the simulator or the verilog version of force
    Really, I am not Sam.



    •   AltAdvertisement

        
       

  3. #3
    Junior Member level 3
    Points: 141, Level: 1

    Join Date
    Jul 2019
    Posts
    29
    Helped
    0 / 0
    Points
    141
    Level
    1

    Re: CRC Error insertion and detection

    Quote Originally Posted by ThisIsNotSam View Post
    you can use the force command in the simulator or the verilog version of force
    How will I detect it? Do I need to make the testbench such that it will emulate the receiver (receive the appended message, divide it by the polynomial and check if final answer is 0). So I will randomly inject errors and also check for it?



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 5
    Points: 8,433, Level: 21

    Join Date
    Apr 2016
    Posts
    1,771
    Helped
    312 / 312
    Points
    8,433
    Level
    21

    Re: CRC Error insertion and detection

    Quote Originally Posted by rrucha View Post
    How will I detect it? Do I need to make the testbench such that it will emulate the receiver (receive the appended message, divide it by the polynomial and check if final answer is 0). So I will randomly inject errors and also check for it?
    it's probably easier to have two instances of the design, one that you insert errors and one that you don't. provide the same inputs and see if the outputs match.
    Really, I am not Sam.



  5. #5
    Junior Member level 3
    Points: 141, Level: 1

    Join Date
    Jul 2019
    Posts
    29
    Helped
    0 / 0
    Points
    141
    Level
    1

    Re: CRC Error insertion and detection

    Quote Originally Posted by ThisIsNotSam View Post
    it's probably easier to have two instances of the design, one that you insert errors and one that you don't. provide the same inputs and see if the outputs match.
    So what you are saying is, 1. Check the CRC for a message without error 2. Check the CRC for a message with error. See if CRC1=CRC2; which they obviously wont be. And since the CRC with an injected error does not match the original CRC, there is an error in the message. Am I right? No need to emulate the receiver.



--[[ ]]--