matthijs/master-project/cλash.git
15 years agoAdd some comments.
Matthijs Kooijman [Thu, 29 Jan 2009 10:36:34 +0000 (11:36 +0100)]
Add some comments.

15 years agoUse spaces instead of tabs.
Matthijs Kooijman [Tue, 27 Jan 2009 16:34:38 +0000 (17:34 +0100)]
Use spaces instead of tabs.

15 years agoPut getInstantiations in the State monad.
Matthijs Kooijman [Tue, 27 Jan 2009 16:32:56 +0000 (17:32 +0100)]
Put getInstantiations in the State monad.

15 years agoPut getArchitecture inside the State monad.
Matthijs Kooijman [Tue, 27 Jan 2009 15:01:57 +0000 (16:01 +0100)]
Put getArchitecture inside the State monad.

15 years agoMake the state monad calling code more pretty.
Matthijs Kooijman [Tue, 27 Jan 2009 14:50:44 +0000 (15:50 +0100)]
Make the state monad calling code more pretty.

15 years agoRun mkHWFunction and addFunc in a State monad.
Matthijs Kooijman [Tue, 27 Jan 2009 14:24:17 +0000 (15:24 +0100)]
Run mkHWFunction and addFunc in a State monad.

This uses a state consisting of a VHDLSession. The invocation of these
functions is a bit ugly now, that will be cleaned up next.

15 years agoDerive Show for the data types we define.
Matthijs Kooijman [Tue, 27 Jan 2009 13:36:17 +0000 (14:36 +0100)]
Derive Show for the data types we define.

15 years agoRemove the Args constructor, just use a list instead.
Matthijs Kooijman [Thu, 22 Jan 2009 19:34:54 +0000 (20:34 +0100)]
Remove the Args constructor, just use a list instead.

15 years agoLook up the port names in the session when generating an architecture.
Matthijs Kooijman [Thu, 22 Jan 2009 19:32:18 +0000 (20:32 +0100)]
Look up the port names in the session when generating an architecture.

15 years agoGenerate a HWFunction for the function that is being generated.
Matthijs Kooijman [Thu, 22 Jan 2009 19:28:34 +0000 (20:28 +0100)]
Generate a HWFunction for the function that is being generated.

15 years agoLookup input port names for instantiations in the session.
Matthijs Kooijman [Thu, 22 Jan 2009 16:40:04 +0000 (17:40 +0100)]
Lookup input port names for instantiations in the session.

This replaces the previously hardcoded portnames.

15 years agoMake getPortMapEntry accept a PortNameMap.
Matthijs Kooijman [Thu, 22 Jan 2009 16:37:14 +0000 (17:37 +0100)]
Make getPortMapEntry accept a PortNameMap.

15 years agoPass around a session variable.
Matthijs Kooijman [Thu, 22 Jan 2009 16:33:51 +0000 (17:33 +0100)]
Pass around a session variable.

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).

15 years agoUse ForSyDe.Backend.VHDL modules to generate VHDL.
Matthijs Kooijman [Thu, 22 Jan 2009 15:33:44 +0000 (16:33 +0100)]
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.

15 years agoRemove the entity generation code.
Matthijs Kooijman [Thu, 22 Jan 2009 13:55:47 +0000 (14:55 +0100)]
Remove the entity generation code.

15 years agoHandle tuple constructors in expressions.
Matthijs Kooijman [Wed, 21 Jan 2009 12:40:07 +0000 (13:40 +0100)]
Handle tuple constructors in expressions.

This enables a hardware model to have multiple output ports, using a tuple
type. The code is still a bit hacky and only works for two-tuples.

15 years agoLet the Adders module export everything.
Matthijs Kooijman [Wed, 21 Jan 2009 12:38:15 +0000 (13:38 +0100)]
Let the Adders module export everything.

15 years agoAdd a haskell model for a half adder.
Matthijs Kooijman [Wed, 21 Jan 2009 12:37:56 +0000 (13:37 +0100)]
Add a haskell model for a half adder.

15 years agoAdd an error message.
Matthijs Kooijman [Wed, 21 Jan 2009 10:52:37 +0000 (11:52 +0100)]
Add an error message.

15 years agoMap output ports as well as input ports.
Matthijs Kooijman [Wed, 21 Jan 2009 10:49:52 +0000 (11:49 +0100)]
Map output ports as well as input ports.

15 years agoGenerate input port names from the argument types.
Matthijs Kooijman [Wed, 21 Jan 2009 10:48:58 +0000 (11:48 +0100)]
Generate input port names from the argument types.

This replaces the hardcoded list of input port names which was used for
testing before.

15 years agoAdd .gitignore file.
Matthijs Kooijman [Mon, 19 Jan 2009 15:47:35 +0000 (16:47 +0100)]
Add .gitignore file.

15 years agoIntial import of some haskell programs.
Matthijs Kooijman [Mon, 19 Jan 2009 15:45:52 +0000 (16:45 +0100)]
Intial import of some haskell programs.

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.