forsyde / forsyde-deep

Other
1 stars 2 forks source link

[CLOSED] VHDL functions for the AbstExt type are not generated correctly #22

Closed HWoidt closed 8 years ago

HWoidt commented 8 years ago

Issue by HWoidt Saturday Jul 11, 2015 at 13:09 GMT Originally opened as https://gits-15.sys.kth.se/ingo/forsyde-deep/issues/22


Reported by joaopizani, Nov 24, 2010

I've written a VERY simple RLE encoder using ForSyDe's deep-embedded API, intending to synthesize it. Simulation with "simulate" went well, and ForSyDe generated VHDL. But in the library generated by ForSyDe (rle_lib.vhd) the VHDL functions for verifying if an AbstExt value is present, and the Prst constructor are missing.

They are replaced by duplicate instances of "absent" functions. If I just replace the word "absent" by "present" in two places in the VHDL code, the project synthesizes and works beautifully...

What steps will reproduce the problem?

  1. runhaskell RLE.hs over the following code: http://hpaste.org/41770/forsyde_rle_encoder
  2. The generated VHDL library in (rle/vhdl/rle_lib/rle_lib.vhd) is this one: http://hpaste.org/41771/forsyde_generated_vhdl_library
  3. Try to compile the design under Quartus.

What is the expected output? What do you see instead? Expected the VHDL design and libraries to compiles and synthesize successfully. Instead, when running the compilation in Quartus, it complains with the following error message: "Error (10289): VHDL Subprogram Specification error at rle_lib.vhd(43): subprogram "absent" is a homograph of another object in the same declarative region"

It turns out that this declaration, and the corresponding definition are really duplicate. But if I replace both occurrences of "absent" by "present" it all works.

What version of the product are you using? On what operating system? ForSyDe 3.1.1 (from Hackage) Haskell Platform 2010.2.0.0 GHC 6.12.3 Quartus 10.0 Ubuntu 10.10

Please provide any additional information below. I have made a small diff file from the comparison between what is generated by ForSyDe and what works. Here it is:

30c30
<      function absent (extabst : tup_2_int8_int16)

---
>      function present (extabst : tup_2_int8_int16)
40c40
<      function absent (extabst : abs_ext_tup_2_int8_int16)

---
>      function present (extabst : abs_ext_tup_2_int8_int16)
75c75
<      function absent (extabst : tup_2_int8_int16)

---
>      function present (extabst : tup_2_int8_int16)
98c98
<      function absent (extabst : abs_ext_tup_2_int8_int16)

---
>      function present (extabst : abs_ext_tup_2_int8_int16)
HWoidt commented 8 years ago

Comment by HWoidt Friday Jul 17, 2015 at 10:18 GMT


Not reproducible with the current forsyde implementation. There is no issue with the generated VHDL code.