The new function expandExpr does something similar to getInstantiations
(and is used instead of it now), but follows a more bottom up approach,
generating new signals as needed and only connecting these signals to
ports at the very end. This allows for more general handling of nested
expressions and will probably make things less complex.
For now, this means that the Translator can only translate the trivial
"wire" hardware model, more support coming up.
This also means that we're using VHDLId's in almost all SignalNameMaps
now, which reduced the conversion from String.
This moves some code from getPortMapEntry into a new function expandArgs,
and also prepares for generating signal declarations in addition to
component instantiations.
This session variable stores a list of available functions and a number
for generating unique names. So far, the session is only used to lookup
output port names and is read only (ie, not returned from functions).
Use ForSyDe.Backend.VHDL modules to generate VHDL.
The current code is still a bit hacky, but no longer contains hardcoded
VHDL and instead builds a VHDL AST which is then printed by modules from
ForSyDe.
Note that this uses internal ForSyDe modules. ForSyDe was modified to
expose these internal modules.
Contains the following files:
* Adders.hs - Some Haskell modelling of hardware adders.
* Alu.hs - A haskell model of an (extremely) simple cpu.
* Bits.hs - Stuff relating to a basic "Bit" datatype.
* Inverter.hs - A haskell model of an inverter.
* Parser.hs - A simple haskell parser using Language.Haskell libraries.
* Shifter.hs - A haskell model of an interactive xor-shifter.
* Sim.hs - Some utilities to run hardware models.
* Translator.hs - A basic program that uses GHC to read Haskell code and
translates it into VHDL. This code is still very preliminary.