You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When wrapping a sum-of-products type in a single-field record type, the generated VHDL is wrong; it seems to me like a superfluous VHDL signal is generated that has the type of the sum-of-products type (equivalently, the record type), but is used both that way and as if it where the product term in one of the sum constructors:
port(w_i1 : instd_logic_vector(29downto0);
[...]
signal repANF_0 : std_logic_vector(29downto0);
signal repANF_1 : unsigned(3downto0);
signal n_6 : unsigned(3downto0);
signal ww1_8 : std_logic_vector(29downto0);
[...]
repANF_0 <= ww1_8;
repANF_1 <= n_6 +to_unsigned(1,4);
n_6 <=unsigned(ww1_8(27downto24));
ww1_8 <=unsigned(w_i1(27downto24));
Where it seems to me it should be this:
[...]
signal repANF_0 : std_logic_vector(29downto0);
signal repANF_1 : unsigned(3downto0);
signal n_6 : unsigned(3downto0);
[...]
repANF_0 <= w_i1;
repANF_1 <= n_6 +to_unsigned(1,4);
n_6 <=unsigned(w_i1(27downto24));
Obviously, if it were used correctly, it wouldn't matter that the signal is superfluous. But right now it is trying to be two things at once.
The VHDL generated above is generated by CλaSH v0.4.1 with Prelude v0.6.1 for the following CλaSH code:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
moduleRecordSumOfProductswhereimportCLaSH.PreludeimportControl.ApplicativedataDbState=DbInitDisp (Unsigned4) | DbWriteRam (Signed14) (Signed14)
| DbDonederiving (Show, Eq)
dataDbS=DbS{dbS::DbState}
topEntity = walkState <^>DbS (DbInitDisp0)
walkState::DbS->Bit-> (DbS, Bit)
walkState (DbS (DbInitDisp n )) i = (DbS (DbInitDisp (n+1) ), 0)
walkState s i = (s , i)
The text was updated successfully, but these errors were encountered:
When wrapping a sum-of-products type in a single-field record type, the generated VHDL is wrong; it seems to me like a superfluous VHDL signal is generated that has the type of the sum-of-products type (equivalently, the record type), but is used both that way and as if it where the product term in one of the sum constructors:
Where it seems to me it should be this:
Obviously, if it were used correctly, it wouldn't matter that the signal is superfluous. But right now it is trying to be two things at once.
The VHDL generated above is generated by CλaSH v0.4.1 with Prelude v0.6.1 for the following CλaSH code:
The text was updated successfully, but these errors were encountered: