On Fri, 22 Feb 2013 08:40:36 -0800 (PST)
This is the idea I'm getting. I haven't gotten a good answer about why I should ever use slv, and I'm getting the idea it's only still around because of inertia. The responses seem to be:
1. SLV is better *because* of its limitations. You *could* use signed/unsigned, but why, when you could use something that does even less?
Exactly. When you pick up your electric screwdriver/drill, there's a
selectable torque ring. When you're using it as a drill, you set the
torque up to max because that's what you want it to do, apply as much
torque as possible to break through. When you're driving #4
machine screws into threaded sockets, you bring the torque way down so
as to not strip the screw.
The right tool for the job is based on what the job is. Signed,
unsigned, and std_logic_vector are different, complimentary tools.
They represent a 2's compliment number, an unsigned number, and an
arbitrary collection of bits, respectively.
When I need to pack a lot of data into a single vector to pipe it
around I build both a record and a corresponding SLV, and use a set of
functions such as:
function TO_SLV(rec : t_pvme_request) return t_pvme_request_slv;
function TO_REQUEST (slv : t_pvme_request_slv) return t_pvme_request;
This can happen either because a code generation tool such as Qsys can
only work with SLV, not records, or if I'm storing mixed data types in
a single RAM, or sending different data types across the same internal
memory bus, etc. And in some of these cases the tools are what force
me to use SLV. But also, these bundled up records, which in their
native form collect signed, unsigned, and std_logic fields, are by their
nature SLV. The idea of running a carry chain up the entire thing
makes no sense, nor is the bit order particularly meaningful.
That same memory bus also has a byte enable vector, which is again
really a collection of individual signals that has no numeric meaning,
and hence truly by its nature an SLV.
Whereas that same memory bus has an address, which is inherently a
number that can be compared, incremented, etc. That the tools force me
to also make that into an SLV is just them being lazy.
2. But wait: with the new 2008 libraries, SLV is about as good as signed/unsigned. (So why not just use signed/unsigned?)
3. Other cores like CoreGen cores will use SLV, so you have to also in order to interface them. (This is valid, although I try to avoid CoreGen when possible, and I can always convert, possibly even in the instantiation with 2008.)
It's 2013, and every vendor's dual-port RAM inference template is still
based on unprotected shared variables, which have been declared illegal
since VHDL-2002. Complete VHDL-2008 support in synthesis tools is like
my 401(k); I hope that it might be ready by the time I retire.