ISSUE 593

Add Proposal  Add Analysis  Edit Class, Environment, or Release
Number 593
Category enhancement
Synopsis Continuous assignment case expressions
State open
Class enhancement
Arrival-DateJul 19 2004
Originator Shalom Bresticker <Shalom.Bresticker@freescale.com>
Release 2001b
Description
This comes from B12 from the old 1364-2001 enhancement requests, by Adam
Krolnik.

This wanted the ability to write something like
assign data_out = case(mux_select)
2'h0: mux_1;
2'h1: mux_2;
2'h2: mux_3;
2'h3: mux_4;
endcase

It is nice and probably not hard to implement,
but does not add new functionality, so we gave it priority MEDIUM

To quote from the old database:

If one wants to write a case expression, they must use an always block. This is
different from the style where
assign statements are used to implement combinational logic. One may decide to
use the ternary operator to
express a pseudo-case structure, but it would seem that this doesn't directly
fit the mold of synthesizable mux
structures.

assign data_out = (mux_select == 0) ? mux1 :
(mux_select == 1) ? mux2 :
(mux_select == 2) ? mux3 :
mux4;

This doesn't really look like a mux - more like a priority select block. One has
to write this to have something look
like a mux.

always @(mux_select or mux1 or mux2 or mux3 or mux4)
begin
case (mux_select)
2'h0 : data_out = mux1;
2'h1 : data_out = mux2;
2'h2 : data_out = mux3;
2'h3 : data_out = mux4;
endcase
end

I would like to propose that a case structure be available to an assign
statement. The above logic could then be
written as:

assign data_out = case(mux_select)
2'h0: mux_1;
2'h1: mux_2;
2'h2: mux_3;
2'h3: mux_4;
endcase

This case statement returns a value equal to the size of the expression
selected.

Motivations:

1. Looks more like a mux structure (1 selector) than equivalent ternary
operator
(possibly multiple selectors) structure.
2. Simpler than creating an always block with a mux inside.
3. Simpler mux structure; only 1 lhs per structure rather than possible
multiple.

[NOTE: the case_statement has three forms 'case', 'casex' and 'casez' all which
are applicable for the continuous version.]

Fix

Unknown
Unformatted



Hosted by Boyd Technology