Christiaan Baaij [Wed, 11 Nov 2009 14:52:33 +0000 (15:52 +0100)]
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Actually make the scrutinee binder removal not crash.
Add scrutinee binder removal transformation.
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Add a trailing newline to HighOrdAlu.
Add comments to the inlinetoplevel transformation.
Update comments for inlinenonrep.
Fix typo.
Fix typo.
Merge branch 'master' of git://github.com/christiaanb/clash into cλash
* 'master' of git://github.com/christiaanb/clash:
TFP has updated/remade. Change hardwaretypes accordingly
Connect resetn port to states.
Fix the resetn signal in the testbench, it is now correctly '0' for 3 ns, and after that '1'
Christiaan Baaij [Thu, 20 Aug 2009 12:22:09 +0000 (14:22 +0200)]
Connect resetn port to states.
Atleast initial state can now easily be added manual.
Be sure to update to the latest 'vhdl' package as the
old one incorrectly pretty printed the "elsif" keyword
Christiaan Baaij [Thu, 20 Aug 2009 07:15:43 +0000 (09:15 +0200)]
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Add a not in isUserDefined.
Let vhld_ty handle free tyvars gracefully.
Add ty_has_free_tyvars predicate.
Split substitute into substitute and substitute_clone.
Rewrite substitute to clone the substitution range.
Don't error on type abstraction when cloning binders.
When inlining top level functions, guarantee uniqueness.
Make all binders unique before normalizing.
Add genUniques function to regenerate all uniques.
Add mapAccumLM helper function.
Don't try to inline non-normalizeable top level functions.
Add andM and orM utility functions.
Add isNormalizeable predicate.
Make isRepr work on TypedThings instead of CoreExpr.
Also inline functions named "fromInteger".
Don't extra non-representable values in simplres.
Use isUserDefined for (not) inlining top level functions.
Add isUserDefined predicate.
Inline all top level functions that look simple.
Merge branch 'master' of git://github.com/christiaanb/clash into cλash
* 'master' of git://github.com/christiaanb/clash:
Work around some bugs in the current clash to make reducer compile correctly
Just name the testbench: testbench; don't add the unique
No longer allow slashes in extended names, they are now stripped
Used unsigned instead of natural as representation of RangedWord
Add resetn ports
Previously, free type vars could result in ugly errors from eval_tfp_int
and friends. Now, a type with free type vars is correctly marked as
non-representable.
Rewrite substitute to clone the substitution range.
This makes substitute no longer use CoreSubst for id substitutions, just
for type substitutions (which we don't have to clone before replacing
them). By cloning the substitution range before every substitution, we
keep the binders in it globally unique.
Don't error on type abstraction when cloning binders.
Since we might encounter type abstractions before normalizations, the old
behaviour broke on polymorphic functions (Though type arguments would have
been propagated, there would still be type abstractions directly applied
to the propagated types).
Note that this not actually clones the type variables, it just leaves them
untouched. Since we should never introduce new type variables, this should
_probably_ work out...
This inlines any function whose normalized version just contains a single
definition. This might be a bit too enthusiastic, though it probably helps
a lot.
Christiaan Baaij [Mon, 17 Aug 2009 10:18:11 +0000 (12:18 +0200)]
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Make letflat work for nonrec lets in rec lets as well.
Revert "Limit flattenLets to non-recursive lets only."
Disable letmerge.
Make letremoveunused work for recursive lets again.
Make letflat work for recursive lets again.
Turn of Normalize debugging again, accidentally committed.
When faced with nested recursive and non-recursive lets, letmerge becomes
complicated very quickly, so we might need to rewrite it if it's really
needed. For now, just disable it to prevent it from breaking things.
Order the extracted bindings from a case expression properly.
Since the case value can use any of the binders bound by the pattern, the
bindings resulting from the pattern should come before the binding from
the value.
Christiaan Baaij [Fri, 14 Aug 2009 14:35:05 +0000 (16:35 +0200)]
Merge branch 'cλash' of http://git.stderr.nl/matthijs/projects/master-project
* 'cλash' of http://git.stderr.nl/matthijs/projects/master-project:
Add lambdasimpl normalization pass.
Make letremoveunused work for non-recursive lets.
Let casesimpl generate non-recursive lets.
Add mkNonRecLets and use it.
Make letmerge work with non-recursive lets.
Limit flattenLets to non-recursive lets only.
Move flattenLets from Normalize to CoreTools.
Make inlinebind work for non-recursive lets.
Add empty let removal normalization pass.
Rename letremove to letremovesimple.
Don't try to simplify nested lets.
Make letflat work with non-recursive lets.
Make letsimpl work on and generate a non-recursive let.
No longer add a top level let before normalization.
Make some normalizations generate nonrecursive lets.
Turn let recursification into its opposite.
This pass puts the value of a lambda in a let binding, to make a lambda
always evaluate to either a let or a simple variable reference. This was
previously not needed, since there used to be a let always (even an empty
one), but this is no longer the case.
This function creates a bunch nested non-recursive lets. It is similar to
MkCore.mkCoreLets, but works only for non-recursive lets, which makes it a
bit more elegant in usage.
flattenLets is currently used for splitNormalized only, which should be
non-recursive lets only. To use it in other places to filter lets, we
should only flatten non-recursive lets, so we can create new non-recursive
lets afterwards.
Make letsimpl work on and generate a non-recursive let.
Previously, letsimpl would work on a recursive let only, and add a new
binding to that recursive let. Now, it works on any let and produces a new
non-recursive let.
No longer add a top level let before normalization.
This was previously required to ensure there was always a let on top
level. However, since we are using nonrecursive lets now and use a
splitNormalized instead of hard matching a Let constructor, there is no
need for an (empty) let at the top anymore.
Merge branch 'master' of git://github.com/christiaanb/clash into cλash
* 'master' of git://github.com/christiaanb/clash:
Hopefully generate completely unique varNames now (also for comp_ins labels)
Generate more unique variable names, generate truely unique entity names
Add boolean or and and, tuple fst and snd function.
Added equals builtin. And fixed show function generation for integers
Class Num is re-exported by CLasH.HardwareTypes, so no need to use the one in Prelude