Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Division example is not giving correct outputs #1

Open
andremmvgabriel opened this issue Aug 18, 2020 · 1 comment
Open

The Division example is not giving correct outputs #1

andremmvgabriel opened this issue Aug 18, 2020 · 1 comment

Comments

@andremmvgabriel
Copy link

Hello,

I'm using Yosys to read and make the synthesis of the Division Verilogs. However, for the verilogs inside the benchmarks folder, the "hierarchy -check -top top_module" step is not working. As so, the circuit synthesis for example is not achievable... Can you verify if everything is correct for this example?

On the other hand, I've tried as well to make the synthesis of the Division verilog inside the benchmarks2 folder (a .sv file). With that one I was able to make it and then able to convert it to a .scd file. However, when I was testing that circuit, the outputs were mostly incorrect... For example, these 2 tests:

  • Dividing 73 and 05 gives 17, which is correct (decimal is 115/5 = 23)
  • Dividing 82 and 05 gives E7, which is not correct (decimal is 130/5 = 231)

If you don't mind, can you also check that circuit?

Thanks for your attention.

Best regards,
André Gabriel

@siamumar
Copy link
Collaborator

Hi, sorry for the delay in reply.

Regarding "hierarchy -check -top top_module", what did you set as the top module and what is the error? It would be easier if you send the entire .yos file and the error reported by Yosys.

Regarding the division inside the benchmarks2 folder, the outputs are actually correct if you treat them as signed numbers. decimal is (-126)/5 = -25. If you look inside "Benchmarks2/div/div_nm_2_n.sv", you will see that all the inputs and outputs are signed. Also "DIV_" (with the underscore) is for signed operations. If you want unsigned operations, please remove "signed" from input and output ports and replace "div_" with "div". You can see the implementation of both "div_" and "div" in "SynthesisLibrary/syn_lib".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants