You either wait for the next rev of VHDL (and then wait a couple of years for the tools to catch up), or you use a temporary variable. I don't know of any other way.
tmp := bit1 & bit2 & bit3; case tmp is when ...
BTW, you shouldn't have parentheses around the case expression.
Unfortunately in the UK you're more employable if you know VHDL. I have written in Verilog and quite like the C type structure. Since I'd like to pay my bills I feel tied to VHDL.
Probably the nicest way is to declare a subtype - you can do this locally in the process, so it doesn't pollute the architecture. Then type-qualify the expression:
process (...) [other declarations] subtype SLV3 is std_logic_vector(2 downto 0); begin ... CASE SLV3'(bit1 & bit2 & bit3) IS ...
Note the apostrophe between subtype name and opening parenthesis.
Depending on the application, you may be able to think of a more apt name for the subtype.
HTH
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
Be *very* careful when you use type-qualified expressions. Indeed, the expression type must be the same as the type name. If this is not the case (like here), a fully vhdl LRM compliant simulator should detect an error here.
Therefore, you'd better to use a type conversion: SLV3 (bit1 & bit2 & bit3)
Can you explain? I can't see why a concatenation of three std_logic is incompatible with my definition of SLV3.
Of course you are correct that the expression must admit of interpretation as the qualifying type, but in this case I think it's OK. I'm happy to be proved wrong if you can cite the appropriate bit of the LRM, though.
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.