FuzzyLogic / Trivium

A Verilog implementation of the Trivium stream cipher
GNU Lesser General Public License v3.0
7 stars 2 forks source link

Behavioral Simulation Error #1

Open vidyagovindan opened 6 years ago

vidyagovindan commented 6 years ago

Hi, I am trying to simulate the Trivium code using the tb that is present in the repo. After running the python code to generate the .txt files. The simulation is unsuccessful, it gives the error: ERROR: Incorrect output in test 1, word 0! 13f251ec != 254f2319, input = d767844

Can you please help to debug this?

FuzzyLogic commented 6 years ago

Hello, did you try testing it with the input and output test vectors that are provided in the repo? Did that work or fail as well? I will try to generate new test vectors and see if I can reproduce the issue.

vidyagovindan commented 6 years ago

Hey, Yeah I tried it with the already provided test vectors too. It failed with that also. I am using Vivado 2016.3 , hope the Vivado version won't be the issue? Manually If I am observing the data_i and data_o , the values in the text files seems to be present but I am not able to figure out why the test is failing.

FuzzyLogic commented 6 years ago

Hello, I just ran a few tests, the provided test vectors work for me. I also generated new sets of input/output test vectors and that worked as well. I am using Vivado 2016.3 too. Apart from that, the Vivado version really shouldn't be the issue, since the design is so simple. How did you add your test vectors to the project? This is what I did:

vidyagovindan commented 6 years ago

Hi, Yes I added the test vectors as mentioned. The tests pass for the first IV and Key values, from the second IV and key values it is failing. Let me download the text files again and check.

vidyagovindan commented 6 years ago

Hello, Still Iam getting this error: ERROR: Incorrect output in test 1, word 0! 1cc5f24c != 0858, input = db7ddcdb The funny part is I can't find "0858" in the output text file nor in the waveform window. I am suspecting the path is wrong? Not sure though. There is this warning when I run the simulation: [XSIM 43-3373] "...XPjct/TriviumCodes/Trivium-master/hdl/tb/trivium_top_tb.v" Line 97. System function $fseek is used as system task. This system function should have a LHS e.g. x=$fseek().

FuzzyLogic commented 6 years ago

Hello, I am also getting the fseek-related warnings you mentioned. I think it is just complaining that the return value is not used. Are the correct input values being input to the module during the tests and is the module provided the expected output? It's a bit difficult to tell what is going on, since I can't reproduce the issue.

vidyagovindan commented 6 years ago

triviumtb_waveform Hi, If you see the image, the waveform reads only 32 bits values for IV and key values from the text files for Test 1. Can you tell what could be causing this ?