Commit Graph

4553 Commits

Author SHA1 Message Date
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
Nick Gasson aa951af2b7 Change 'signdness' to 'signdness' 2008-07-10 19:27:17 +01:00
Nick Gasson 55747bf79d Refactor signdness changing code into a single function
This is the code that generated calls to signed/unsigned in
the VHDL output.
2008-07-08 13:07:11 +01:00
Nick Gasson 1cd7689d03 Fix casting with signed/unsigned expressions
Previously the code generator tried to infer the VHDL types. Now it
takes a much more dumb approach and forces the VHDL type to be
the same as the ivl type (derived from ivl_expr_signed and
ivl_expr_width) in the expression tree. This works much better :-)
2008-07-08 12:58:50 +01:00
Nick Gasson bd5cc96956 Correct vector sizes for bit select 2008-07-08 00:20:31 +01:00
Nick Gasson a0dbb1aa5d Fix more bugs in part selects 2008-07-07 21:45:27 +01:00
Nick Gasson 4777966b4c Bit select bug fixes 2008-07-07 21:19:59 +01:00
Nick Gasson 860a74ddd8 Allow LPMs in port maps 2008-07-07 20:41:29 +01:00
Nick Gasson 2bb645e0bc Refactor LPM code to allow lpm->expr function 2008-07-07 19:46:18 +01:00
Nick Gasson 47db80315c Add sign extension LPM 2008-07-07 19:27:52 +01:00
Nick Gasson 0348664512 Correctly determine VHDL type of LHS of part select 2008-07-07 16:35:39 +01:00
Nick Gasson 3987e0753d Fix case where booleans are compared against vectors 2008-07-07 16:31:27 +01:00
Nick Gasson 6b73cc39a5 Add Active_High support func and fix LPM part select 2008-07-07 16:17:54 +01:00
Nick Gasson b0de1a8d7e Implement part select for LHS of assignment 2008-07-07 16:11:45 +01:00
Nick Gasson 37fe6e4219 Dummy implementation of IVL_LO_BUF* 2008-07-07 15:49:51 +01:00
Nick Gasson 89cdbf63be Reduction LPM types 2008-07-07 15:45:20 +01:00
Nick Gasson 7f955cc070 Move the VHDL support package 2008-07-07 15:36:13 +01:00
Nick Gasson 4db5b9d7ed Add unary OR/NOR
These are currently implemented with reference to an external
Reduce_OR function
2008-07-07 15:23:57 +01:00
Nick Gasson dadd145d09 Add message for unsupported LPM nexus pointer 2008-07-07 15:04:28 +01:00
Nick Gasson bdf5ee7ab7 Concat LPM 2008-07-07 14:48:57 +01:00
Nick Gasson ebaa4c7d5d Implement assignment to part select properly
Previously the base of the lval was ignored, this ensures
the correct assignment is generated.
2008-07-07 11:00:27 +01:00
Nick Gasson c33600bcc3 Add concatenation operator 2008-07-06 18:21:34 +01:00
Nick Gasson 85d2cc78d6 Finish ternary operator expansion 2008-07-06 17:56:48 +01:00
Nick Gasson 18071562ba Partially implement ternary expressions
This handles the case where the expression appears as the
right hand side of an assignment. The expression is converted
into a regular if statement.
2008-07-04 21:55:51 +01:00
Nick Gasson 5aeff6d47d Merge blocking and non-blocking assignment code 2008-07-04 20:07:38 +01:00
Nick Gasson a298b03735 Add bitwise OR 2008-07-04 12:05:49 +01:00
Nick Gasson 3d0a2b55ce Avoid declaring same function multiple times
If it appears in multiple places in the hierarchy
2008-07-04 12:03:37 +01:00
Nick Gasson 19871efd5a Fix bug where sensitivity might reference undefined signals 2008-07-04 11:58:33 +01:00
Nick Gasson 1410c339de Make sure any calls to numeric_std Resize have correct type
The signed/unsigned-ness of an expression needs to be
preserved over any call to Resize. Also add a sanity
check to make sure non-vector types are not resized.
2008-07-04 11:36:11 +01:00
Nick Gasson 96d32b29c9 Translate logical expressions correctly.
For logical AND/OR in VHDL both operands must be of the
same type (Boolean)
2008-07-04 11:23:32 +01:00
Nick Gasson 88816e150a Properly parenthesise unary operators 2008-07-04 11:17:24 +01:00