Nick Gasson
2d79e1a2e0
Store the currently active entity
2008-07-19 14:45:00 +01:00
Nick Gasson
7b311b6adb
Translate internal delays in assignments
2008-07-18 14:47:35 +01:00
Nick Gasson
df4a380e42
Fix implementation of IVL_LPM_UFUNC
...
Function name was not correct.
2008-07-18 14:31:12 +01:00
Nick Gasson
6ff80e80a4
Catch case where (un)signed is converted to boolean
2008-07-18 12:30:24 +01:00
Nick Gasson
8b6b111541
Add IVL_LPM_CMP_EQ
2008-07-18 11:58:26 +01:00
Nick Gasson
fd8f01e317
Add IVL_LPM_CMP_GE
2008-07-18 11:56:00 +01:00
Nick Gasson
00317dd47f
Dummy implementation of $time
2008-07-18 11:50:05 +01:00
Nick Gasson
e9637f6d11
Generate synthesisable code for sequential processes
...
Whilst adding `wait until ...' at the end of every
process is a valid translation of the input, it is not
actually synthesisable in at least one commercial
synthesiser (XST). According to the XST manual the
correct template is to use `wait until ...' at the
start of sequential processes and `wait on ...'
(equivalent to `wait until ...' with 'Event on all
the signals) at the end of combinatorial processes.
This patch implements that.
2008-07-17 17:36:42 +01:00
Nick Gasson
1f9ed2c5ec
VHDL AST element for `wait on' statement
2008-07-17 17:23:21 +01:00
Nick Gasson
7677b59650
Make sure offset of IVL_LPM_ARRAY is integer
2008-07-17 16:41:34 +01:00
Nick Gasson
9cf4792d53
Translate array references in expressions
2008-07-17 14:47:10 +01:00
Nick Gasson
4d9f029000
Generate correct array bounds
2008-07-17 14:38:07 +01:00
Nick Gasson
9916686c24
Convert constant bits to integers
2008-07-17 14:29:56 +01:00
Nick Gasson
c86377790f
Automatically convert constant bit strings to integers
2008-07-17 14:26:35 +01:00
Nick Gasson
2a791bfb38
Assignment to arrays
2008-07-17 13:41:44 +01:00
Nick Gasson
1d3ac6bc1f
Generate VHDL array type declarations of Verilog arrays
2008-07-17 13:08:55 +01:00
Nick Gasson
3fa5a04947
Merge branch 'vhdl' into array
2008-07-17 12:01:09 +01:00
Nick Gasson
7c5b0f737c
Class for VHDL type declarations
2008-07-17 11:59:02 +01:00
Nick Gasson
c116808fdb
Remove duplicated code
2008-07-17 11:46:36 +01:00
Nick Gasson
553f3d77a9
Code for VHDL array type
2008-07-17 11:43:59 +01:00
Nick Gasson
642fbe9fc5
Correct check for arrays
2008-07-17 11:31:06 +01:00
Nick Gasson
395a2248d8
Make sure 1-bit constants are std_logic not (un)signed
2008-07-16 16:52:15 +01:00
Nick Gasson
be67cae29f
Add translation for IVL_ST_CASEX
2008-07-16 16:42:44 +01:00
Nick Gasson
f62a00bedb
Fix LPM binop with different signedness
...
Need to explicitly cast between signed/unsigned to
make sure both arguments have the same type or the
VHDL won't compile.
2008-07-16 16:20:08 +01:00
Nick Gasson
646a6056a2
Add IVL_LPM_CMP_EEQ support
2008-07-16 12:50:55 +01:00
Nick Gasson
4504c2bceb
Fix initialisation order bug with `if' statements
...
If an assignment appears inside an if statement branch
it could be incorrectly used as the signal's initial
value.
2008-07-16 12:11:00 +01:00
Nick Gasson
d343db34fd
Fix initialisation order
...
Initial processes set a magic flag in the code generator
which allows it to push constant assignments into the
VHDL signal initialisation and omit the assignment.
However, it should only do this if the signal has not
already been read (otherwise the previous read would
not get the undefined value as expected)
2008-07-16 12:00:11 +01:00
Nick Gasson
b5e12077b2
Fix assignment to lval slice
...
It was broken in yeserday's refactoring
2008-07-15 18:40:30 +01:00
Nick Gasson
f3753ea9ad
Add warning that arrays are not yet implemented
2008-07-15 18:09:18 +01:00
Nick Gasson
45e289d32d
Implement IVL_LPM_SHIFTL/R
2008-07-15 18:01:37 +01:00
Nick Gasson
40cabff44f
Leave blank line at end of function
2008-07-15 16:30:50 +01:00
Nick Gasson
a9c98ad5f2
Handle `if' with empty cond_true part
...
Fixes assertion failure with following statement:
if (foo)
begin
end
else
...
2008-07-15 14:26:19 +01:00
Nick Gasson
b8e758edf0
Refactor LPM code
2008-07-15 14:09:24 +01:00
Nick Gasson
0b48f69b4e
Tidy up blocking assignment code
2008-07-15 10:44:48 +01:00
Nick Gasson
d1e7e325b7
Remove redundant edge_detector function
2008-07-14 21:34:48 +01:00
Nick Gasson
75b1db0add
Fix assignment with ternary RHS
...
This was also broken in the last commit
2008-07-14 21:27:21 +01:00
Nick Gasson
6e965523a1
Fix PV assignment (was broken in last commit)
2008-07-14 21:09:19 +01:00
Nick Gasson
8589c0691b
Refactor assignment code
2008-07-14 21:04:09 +01:00
Nick Gasson
99ef8ec4f1
Simplify edge detector code
...
Now generates a `wait until' statement rather than a
sensitivity list.
2008-07-14 20:29:49 +01:00
Nick Gasson
d22c9a8b05
Simplify blocking assignment
...
Now generates 'wait for 0 ns' after non-blocking assignment
2008-07-14 19:54:45 +01:00
Nick Gasson
f84f50842c
Support bufif for tri1 nets
2008-07-14 19:13:11 +01:00
Nick Gasson
65720f49fe
Simple bufif cases
2008-07-14 19:00:58 +01:00
Nick Gasson
6243736481
Pull-up/pull-down logic devices
2008-07-14 12:04:20 +01:00
Nick Gasson
e331e4831b
Fix nexus_to_expr where nexus has IVL_LPM_SELECT_PV
2008-07-14 11:53:38 +01:00
Nick Gasson
78ee61558d
Remove redundant test
...
Signal is guaranteed to appear in arch_scope or its parent
by the surrounding `if' statement.
2008-07-13 15:27:07 +01:00
Nick Gasson
07c4ff7ea7
Add assertion about result of lpm_to_expr
2008-07-13 15:26:03 +01:00
Nick Gasson
e5422dddd2
Remove useless `ignore' param to nexus_to_expr
2008-07-13 15:24:35 +01:00
Nick Gasson
6af201ea03
Refactor nexus expansion functions.
...
Now a single function nexus_to_expr
2008-07-13 15:17:14 +01:00
Nick Gasson
27a40cfdcd
Constant assignments to outputs
...
If the Verilog source contained a continuous assignment
of a constant to an output, it would not be present in
the VHDL output. This patch generates a VHDL continous
assignment in these cases.
2008-07-13 13:02:17 +01:00
Nick Gasson
3bd480a375
Allow ouput to be read if connected to child output
...
If output P of A is connected to output Q of B (and A is
instantiated inside B) then VHDL does not allow B to read
the value of Q (also P), but Verilog does. To get around
this the output Q is mapped to P_Sig which is then connected
to P, this allows B to read the value of P/Q via P_Sig.
2008-07-13 12:41:02 +01:00