Commit Graph

118 Commits

Author SHA1 Message Date
Martin Whitaker e5075c1340 Fix GitHub issue #306 - segfault when synthesising deassign statement.
Synthesis doesn't properly support any of the procedural continuous
assignment statements, so output a "sorry" message and abort synthesis.

(cherry picked from commit 387d18d222)
2020-02-09 18:27:19 +00:00
Martin Whitaker 0ffbb2b1de Fix for GitHub issue #115 - synthesis aborts on case with max guard of 0.
The calculation of the required multiplexer width was incorrect for
the corner case of a single guard value of zero.

(cherry picked from commit 27213f2af8)
2016-07-23 00:15:43 +01:00
Martin Whitaker ca1d7ccffe Temporary fix for br993 - assertion failure in flip-flop synthesis.
(cherry-picked from master branch)

Synthesis does not currently support some commonly used styles for
representing flip-flops, e.g.

  q <= 0;
  if (en) q <= 1;

or

  if (clr) q <= 0;
  if (set) q <= 1;

For now, output a "sorry" message.
2016-01-30 22:44:26 +00:00
Martin Whitaker faf9bfe158 Fix for br994 - assertion failure when synthesising a mux.
(cherry-picked from master branch)

The elaborator allows the RHS of assignment to be wider than the
LHS. When using an if statement to represent a mux, this meant the
mux inputs could be different widths, resulting in an assertion
failure during synthesis. The fix is to prune the RHS to match the
LHS for each assignment. This has the benefit of minimising the
mux width.
2016-01-30 20:19:05 +00:00
Martin Whitaker 086ce04cf5 Temporary fix for br995 - assignment to memory not supported in synthesis.
(cherry-picked from master branch)

For now, output a "sorry" message.
2016-01-30 17:05:09 +00:00
Martin Whitaker b242663cae Support negedge flip-flops in synthesis and in vvp.
Also extend the support for FF asynchronous set values to vvp and
fix the dff functor in vvp to correctly model asynchronous set/clr
behaviour.
2015-06-13 16:47:57 +01:00
Martin Whitaker d39c284055 Observe and propagate failures when synthesising lval concatenations. 2015-06-13 16:47:57 +01:00
Martin Whitaker e0cdd71984 Minor cleanup and simplification of aset_value changes. 2015-06-08 21:20:49 +01:00
Johann Klammer 81e1735959 establish support for aset_value and reorder clauses so vlog95 doesn't fail anymore. 2015-06-08 20:34:50 +01:00
Johann Klammer 3fb65eb51a single bit reset 2015-06-08 20:34:43 +01:00
Martin Whitaker 3080f5730d Better implementation of assignment lval concatenation synthesis. 2015-06-08 20:27:38 +01:00
Larry Doolittle 2739f83702 Spelling fixes in C and C++ comments 2015-06-04 15:00:29 -07:00
Martin Whitaker 1b3e321d35 Eliminate a few new compiler warnings. 2015-05-04 22:32:29 +01:00
Cary R 02ee3874e7 Space/code cleanup and warn that vvp does not support S/R D-FF 2015-04-20 15:41:44 -07:00
Johann Klammer 891399185f lhs partsel and sync scramble 2015-04-20 15:11:40 -07:00
Cary R 228a3f123a For some local nets fix the local flag and file/line information 2015-01-14 16:40:30 -08:00
Cary R 074f7a7a49 Fix undefined access in for loop synthesis 2015-01-14 15:11:36 -08:00
Martin Whitaker 60ab1daa1f Restore some master branch fixes lost in the vec4-stack merge. 2014-12-07 12:10:15 +00:00
Stephen Williams 2aeb3871ed Merge branch 'master' into vec4-stack
This was a challenging merge...
Conflicts:
	elab_scope.cc
	synth2.cc
	tgt-vvp/eval_expr.c
	vvp/vthread.cc
2014-11-13 16:26:15 -08:00
Stephen Williams ea21fb856e Mux with default, handle possible large selector. 2014-11-09 16:49:21 -08:00
Martin Whitaker 754899c99e Make asynchronous case statement synthesis more robust.
Added various error/warning messages for behaviour not supported
in synthesis. Also give correct behaviour when multiple case item
expressions evaluate to the same constant value.
2014-11-09 20:20:03 +00:00
Cary R f4c88b4a01 Add message that L-value concatenation is not supported in synthesis 2014-08-07 16:26:08 -07:00
Stephen Williams 714795709c Handle casez without default case.
casez statements without default cases can get their input from
the context. This handles that situation properly.
2014-07-19 17:22:33 -07:00
Stephen Williams 7b10570e11 Synthesis handle blocks of FF with unique CE
Like this:
  ... if (ce0) foo <= foo_in;
  ... if (ce1) bar <= bar_in;
Note that this is within a block, and represents multiple FF nodes
with different clock enables.
2014-07-19 15:17:53 -07:00
Stephen Williams d5fb0f4344 Handle some tricky conditions assignments to parts.
When for example assigning to foo[<x>] within a contitional, and
doing synthesis, we need to create a NetSubstitute device to manage
the l-value bit selects.
2014-07-14 16:46:58 -07:00
Cary R 6101044bff Fix gcc compile warning 2014-06-17 10:47:25 -07:00
Stephen Williams c6e44f2da1 Fix argument ordering for synthesized casez compare. 2014-06-16 09:45:03 -07:00
Stephen Williams 3c0a982ab3 More flexible synthesis of DFF with asynchronous set/reset. 2014-06-15 19:10:09 -07:00
Stephen Williams 0f85bf0b9a Basic DFF asynchronous set/reset synthesis support. 2014-06-15 18:22:02 -07:00
Stephen Williams ccce9d9271 Merge branch 'master' into x-sizer5 2014-06-14 19:13:42 -07:00
Stephen Williams 6d2fa6e579 case/x/z synthesis with constant case expression.
If the case expression is constant, then the guards probably are
not, and the synthesis should be handled differently.
2014-06-13 18:22:24 -07:00
Stephen Williams f8dc430fe5 Add synthesis support for casez statements.
This generates an EQZ LPM device that carries the case-z-ness to
the code generator.

Also add to the vvp code generator support for the EQZ device so
that the synthesis results can be simulated.

Account for the wildcard devices in the sizer.
2014-06-13 18:01:41 -07:00
Stephen Williams 26f71f2d94 Handle special case of missing condit inputs.
It shouldn't be possible, but sometimes is, that a NetCondit is
missing input nets during async synthesis. Handle this by generating
a place-holder net and printing a warning.
2014-06-12 17:50:44 -07:00
Cary R 12379ed26a Fix spacing issue. 2014-06-07 18:22:42 -07:00
Stephen Williams 41ff18206a NetCase::synth_async gets a better handle on partly used inputs
Better handle the case where the output for some pins comes from
an earlier assignment. This allows for multiple ways to specify
default outputs for some cases: the default: case and pre-assignment.
2014-06-07 10:53:40 -07:00
Stephen Williams ded1bd4949 Sanity check to prevent bad code getting through synth2 blending
When conditional ports are blending (by allowing NetPartSelects be
connected together to the outputs) make sure there isn't an accidental
overlap of drivers that invalidates the process.
2014-06-02 15:42:02 -07:00
Stephen Williams ef79f538d5 When making NetCondit objects, handle output part select.
When a mux (NetCondit) is only writing to a part of the output
vector (and using only a part of the inputs) then blend the mux
output with the previous statement output.
2014-05-25 18:33:26 -07:00
Stephen Williams 76883fa18c NetCondit synthesis accounts for smaller l-values
If both conditions of a NetCondit device assign to the same subset
of l-value bits, then generate a smaller NetMux device that only
switches the affected bits.
2014-05-24 20:08:48 -07:00
Stephen Williams f16c67d45a synth2 NetForLoop synthesis works a lot like begin/end blocks.
Using the synth_async_block_substatement_ makes the for-loop
synthesis properly handle the chance that there are default
inputs.
2014-05-17 16:58:36 -07:00
Stephen Williams 020e280a98 nodangle functor accounts for NexusSet links
In a design, there may be lingering NexusSet objects, or the
nodangle may itself use NexusSet objects. This creates links,
and this should not confuse the functor.

While we are at it, clean up some handling of events structures.
2014-05-08 15:05:09 -07:00
Stephen Williams 109c5d895d Synthesis of assignment that is part of larger block.
It is possible for an assignment statement to be part of a
grander complex that has lots of outputs, not all handled
by this particular assignment. In that case, the assignment
may need to figure out which output it is supposed to bind to.
2014-05-08 15:05:08 -07:00
Stephen Williams ce864fc634 Synthesis of NetForLoop step that ahs compressed assignment operators. 2014-05-08 15:05:08 -07:00
Stephen Williams be0c61051d Add synthesis of for-loops
This required keeping for-loops as actual things through the
netlist form so that the synthesizer can get at and understand
the parts of the for-loop. This may improve vvp code generation
in the future, but for now continue to present to the vvp code
generation the block-while form.
2014-05-08 15:05:08 -07:00
Stephen Williams ec0c66ff25 Fix internal error elaborating types used in different scopes
Some types, i.e. vector types with parameterized dimensions,
may have different elaboration results in different scopes.
Handle those cases in the elaboration caches.
2014-05-08 15:05:08 -07:00
Stephen Williams 5893d13ea3 Don't connect NetFF CE pin if it is not needed
When the clock enable is not generated, don't try to hook it
up then detach it. That will make a mess that needs clean up.
Instead, leave unused ce pins (Enable) unconnected.
2014-05-08 15:05:08 -07:00
Stephen Williams 8d9f3a0920 Fix crashes scanning links.
Signals are collected in a link map that uses the Link class so that
it doesn't need to save Nexus objects. But naked uses of Link don't
set the node_ and pin_zero_ members. So initialize them to zero so
that Nexus scanners can skip these naked Links.
2014-05-08 15:05:08 -07:00
Stephen Williams 17be8e8c7c Handle special case of if inside of block.
If statements within blocks can confuse the synthesizer when there
are outputs that are assigned ahead of the if statement. This patch
handles that case.
2014-05-08 15:05:08 -07:00
Stephen Williams f43080fbcb Detect proper support for missing else_ without latches (synthesis) 2014-02-15 14:54:58 -08:00
Stephen Williams 4e81939eda Handle asynchronous if-without-else synthesis. 2014-02-15 14:16:22 -08:00
Stephen Williams be1130ddbf More robust case statement synthesis
Handle the cases that the case statement carries complet sub-
statements. This is just a generalization of what is already
there.
2014-02-09 17:30:30 -08:00