Previously, there were three different functions for the top entity,
initial state and test input. Now, there is just a single one, which
guarantees that these things are properly linked together. This should no
also support generating multiple entities at the same time (though there
is no top level interface for this yet).
This change also makes the testbench generation optional. A bunch of
functions were moved from Utils to GhcTools, to prevent a dependency loop.
This moves some stuff from NormalizeTools and NormalizeTypes into the
(new) BinderTools and TranslatorTypes. This also puts most of these
function in the TranslatorSession instead of the TransformMonad.
Previously, first all function would be (recursively) normalized, and then
VHDL would be generated. Now, functions are normalized when needed, and
recursion is done while generating VHDL (so we know exactly which
components we are instantiating).
This disables the testbench and TFVec constructor for now, I'll fix that
in the next commits.
This also moves some code around, to prevent loops between Generate and
VHDL (again...).
The VHDLSession and NormalizeSession have been removed, and replaced with
the (previously unused) TranslatorSession. There are a few backward
compatibility aliases in place, so the next commit will probably remove
these and do a bunch of trivial replaces all over the code.
Merge branch 'master' of git://github.com/christiaanb/clash into cλash
* 'master' of git://github.com/christiaanb/clash:
TFVec builtin should now completely work
Clean up imports in Generate.hs
Use createDirectoryIfMissing to create the vhdl directory, as it can create the parent directories too
Reflect API changes of clash in clash-nolibdir
Bring back listBind(ings) in Utils.hs by reorganising Translator.hs and GhcTools.hs
Fix a few comments so Haddock will complete
Further clean up Translator.hs (almost done now)
Cleanup Translator.hs
Fail again when we find a global function
Partially fixed TFVec builtin function. Still needs to be verified
This bug could be triggered when the scrutinee was a datatype containing a
non-representable value. This is probably not translatable, but handle it
properly anyway.
Prevent conflicts with inlinenonrep in normalization.
This is a followup on ebdc2024d7cf71: Let inlinefun inline everything non-representable.
which make inlinefun more general. A few other normalizations tried to
prevent loops with inline fun, but now work correctly for the (new)
inlinenonrep.
Merge branch 'master' of git://github.com/christiaanb/clash into cλash
* 'master' of git://github.com/christiaanb/clash:
Quick hack implementation of FSVec literals, needs to be fixed
We need the latest vhdl package
We now make a show function for all default datatypes.
Add automated testbench generation according to supplied test input
Previously, no selector cases were created for wild binders, using the
hacky is_wild predicate. Now, this checks the free variables of the case
value instead.
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Generate proper VHDL for top level bindings with no arguments.
Use is_local_var for limiting appsimpl and letsimpl.
Add newline at the end of file.
Add is_local_var predicate.
Santize comment dashes position.
Normalize all used global binders.
Generate proper VHDL for top level bindings with no arguments.
Previously, a = b bindings would always generate an unconditional
assignment. Now, they use genApplication to generate VHDL, and
genApplications knows how to generate unconditional assignments when b is
a local identifier, and a component instantiation when b is a top level
binder.
Use is_local_var for limiting appsimpl and letsimpl.
Previously, appsimple and letsimpl would refrain from simplifying any Var
expression, since they are already simple. Now, they only refrain from
simplifying local variables, so references to top-level bindings will
still be simplified. This enables proper normalization of top level
bindings without arguments.
This allows us to comment some lines in and out without having to remember
the exact position of the comment dashes (to prevent unneeded changes in
git).
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Let inlinefun inline everything non-representable.
Unify typeprop and funprop into argprop.
Extract only representable arguments.
Add predicates for testing representability of types.
Let inlinefun inline everything non-representable.
This changes its name to inlinenonrep and makes it inline everything that
is not representable (which helps in particular for dictionary
construction expressions...).
I've not yet changed the conditions in various other transforms, so if
something silly would happen like having a dictionary as the value or
scrutinee of a case of let expression, things might go into an infinite
loop.
Also, since HTypes are generated very often now, things are really
starting to slow down...
Previously, anything but types and functions was extracted. This
definition is slightly more general, but it should not matter for the
programs we work with.
Make vhdl_ty and friends return errors with Either.
Previously, error messages were passed forward. However, this does not
allow a type lookup to gracefully fail, which will be needed for
normalization soon. Now, error messages are returned using an Either
value, so they can be ignored at top level if needed.
Previously, dataconstructor arguments that had no arguments themselves
(eg. False, or High), would be extracted from an argument list, even
though they were just simple variable references. Since such a datacon can
be translated to a VHDL literal and VHDL supports mapping expressions (at
least constant expressions) to a port, there is no need for extraction
anymore.
* git://github.com/darchon/clash:
We now output VHDL types in the correct order
Removed the need for a special vector-type map.
Added builtin functions: concat, reverse, iterate, iteraten, generate and generaten