J
JohnP
Guest
This question relates to Ashenden's Designers Guide 2nd Ed. P233.
Ashenden describes a user defined package "cpu_types"
which contains these definitions:-
TYPE address IS blah . . blah
TYPE status_value IS (idle, fetch, mem_read, mem_write, etc ) -- enumerated type
cpu_types does not contain a definition of "="( value1 , value2 )
However the Math_Complex package contains a function:
"=" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR ) return BOOLEAN;
Ashenden then gives an example of the use of objects in cpu_types :-
no "USE" statements . . . .
ENTITY address_decoder IS
PORT(addr : IN work.cpu_types.address ;
status : IN work.cpu_types.status_value ;
mem_sel : OUT BIT ) ;
END ENTITY address_decoder ;
ARCHITECTURE funct OF address_decoder IS
CONSTANT mem_low : work.cpu_types.address := x"00" ;
BEGIN
mem_decoder : mem_sel<= '1' when
(work.cpu_types."="(status, work.cpu_types.fetch) -- where does this come from ?
OR
work.cpu_types."="(status, work.cpu_types.mem_read) - and this?
OR
another boolean expression etc etc
.. . . .
Can somebody tell me
1. Is "="(status, work.cpu_types.fetch) the complex maths function ?
2. If it is then status and work.cpu_types.fetch are the wrong types
for the function
Or
3. What is going on with the example ?
Ashenden describes a user defined package "cpu_types"
which contains these definitions:-
TYPE address IS blah . . blah
TYPE status_value IS (idle, fetch, mem_read, mem_write, etc ) -- enumerated type
cpu_types does not contain a definition of "="( value1 , value2 )
However the Math_Complex package contains a function:
"=" ( L: in COMPLEX_POLAR; R: in COMPLEX_POLAR ) return BOOLEAN;
Ashenden then gives an example of the use of objects in cpu_types :-
no "USE" statements . . . .
ENTITY address_decoder IS
PORT(addr : IN work.cpu_types.address ;
status : IN work.cpu_types.status_value ;
mem_sel : OUT BIT ) ;
END ENTITY address_decoder ;
ARCHITECTURE funct OF address_decoder IS
CONSTANT mem_low : work.cpu_types.address := x"00" ;
BEGIN
mem_decoder : mem_sel<= '1' when
(work.cpu_types."="(status, work.cpu_types.fetch) -- where does this come from ?
OR
work.cpu_types."="(status, work.cpu_types.mem_read) - and this?
OR
another boolean expression etc etc
.. . . .
Can somebody tell me
1. Is "="(status, work.cpu_types.fetch) the complex maths function ?
2. If it is then status and work.cpu_types.fetch are the wrong types
for the function
Or
3. What is going on with the example ?