On Nov 26, 4:17 pm, Andy <jonesa...@comcast.net> wrote:
> On Nov 26, 2:32 pm, Dave <dhsch...@gmail.com> wrote:
>
>
>
>
>
> > I am currently using records to group signals together in some
> > synthesizable VHDL code, for readability as much as anything else. The
> > signals within the record are driven by one of three processes, with
> > each element of the record having only one driver. This synthesized
> > fine in ISE 9.2, but now that I want to simulate it, the ISE Lite
> > simulator is complaining about a signal having multiple drivers. Does
> > anyone know what the LRM says here? I know that the record is,
> > overall, decared as a signal, and could be seen as having multiple
> > drivers, but I'm finding this interpretation rather inconvenient right
> > now... and am surprised that the synthesizer and simulator aren't on
> > the same page with this.
>
> > Example code:
>
> > type recType is record
> > a: std_logic;
> > b: std_logic;
> > end record;
>
> > signal rec : recType;
>
> > process(clk)
> > if rising_edge(clk) then
> > rec.a <= input_1;
> > end if;
> > end process;
>
> > process(clk)
> > if rising_edge(clk) then
> > rec.b <= input_2;
> > end if;
> > end process;
>
> Every process that drives any element of the record needs to drive
> EVERY element of the record. With resolved data types (SLV),
> "undriven" elements can be driven with 'Z'. I find it best to declare
> a constant of that type with the type declaration, and that constant
> defines every element to 'Z'. Assign the signal with the constant at
> the top of each process that drives any part of the signal, and you're
> done. Not very simulation efficient, but until we get user defined
> modes for record type ports, I don't know of another way, except to
> break out different parts of the record as separate signals/ports.
> Note that continuous assignments to 'Z' are optimized out in
> synthesis.
>
> Andy- Hide quoted text -
>
> - Show quoted text -
This makes sense. I left out the fact that some of the elements are of
integer type, and this seems important because there's no resolution
function for that type. If everything were based on std_logic, I think
I'd be fine.
|