wtr
Full Member level 5
Hello,
Background - After 10 years in the business I was writing my own collaborations of VHDL rules/ best practices etc. I decided to review one of the books on my shelf, "The student Guide to VHDL" by Peter J. Ashenden.
Chapter 7.1 Package Declarations, Figure 7-1 and Figure 7.2
What is this ."=" opreator? I see no infix function declared that overloads =.
If I was writing this myself using an expanded selected names (because the point of the lesson is why we use..."use") then I would have done
Background - After 10 years in the business I was writing my own collaborations of VHDL rules/ best practices etc. I decided to review one of the books on my shelf, "The student Guide to VHDL" by Peter J. Ashenden.
Chapter 7.1 Package Declarations, Figure 7-1 and Figure 7.2
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 package cpu_types is constant word_size : positive := 16; constant address_size : positive := 24; subtype word is bit_vector(word_size-1 downto 0); subtype address is bit_vector(address_size-1 downto 0); type status_value is (halted, idle, fetch, mem_read, mem_write, io_read, io_write, int_ack); end package cpu_types; entity address_decoder is port( addr : in work.cpu_types.address; status : in work.cpu_types.status_value; mem_sel, int_sel, io_sel : out bit); end entity address_decoder; architecture functional of address_decoder is constant mem_low : work.cpu_types.address := x"000000"; constant mem_high : work.cpu_types.address := x"EFFFFF"; constant io_low : work.cpu_types.address := X"F00000"; constant io_high : work.cpu_types.address := x"FFFFFF"; begin mem_decoder : mem_sel <= '1' when (work.cpu_types."="(status, work.cpu_types.fetch) or when (work.cpu_types."="(status, work.cpu_types.mem_read) or
What is this ."=" opreator? I see no infix function declared that overloads =.
If I was writing this myself using an expanded selected names (because the point of the lesson is why we use..."use") then I would have done
Code VHDL - [expand] 1 when status=work.cpu_types.fetch