RESOLVED SIGNALS Used for situations where 2 outputs

  • Slides: 11
Download presentation
RESOLVED SIGNALS Used for situations where 2 outputs drive one signal. Example of a

RESOLVED SIGNALS Used for situations where 2 outputs drive one signal. Example of a resolved signal declaration: type tri_state_logic is (‘ 0’, ‘ 1’, ‘Z’); Next , we need to write a function to take a collection of values of this type tri_state_logic_array is array(integer range<>) of tri_state_logic; signal s 1: resolve_tri_state_logic;

RESOLVED SIGNALS Example 1: A resolution function for resolving multiple values from tristate drivers.

RESOLVED SIGNALS Example 1: A resolution function for resolving multiple values from tristate drivers. function resolve_tri_state_logic(values: in tri_state_logic_array) return tri_state_logic_is variable result: = tri_state_logic: =‘Z’; begin for index in values’range loop if values(index) /= Z then result : = values(index); end if; end loop; return result; end function resolve_tri_state_logic;

RESOLVED SIGNALS The following example shows a package interface and the corresponding package body

RESOLVED SIGNALS The following example shows a package interface and the corresponding package body for the 4 state multivalued logic type. The constant resolution_table is a lookup table used to determine the value resulting from two source contributions to a signal of the resolved logic type. package mvl 4 is type mvl 4_ulogic is (‘X’, ’ 0’, ’ 1’, ’Z’); type mvl 4_ulogic_vector is array(natural range <>) of mvl 4_ulogic; function resolve_mvl 4(contribution: mvl 4_ulogic_vector) return mvl 4_ulogic; subtype mvl 4_logic is resolve_mvl 4_ulogic; end package mvl 4;

RESOLVED SIGNALS package body mvl 4 is type table is array(mvl 4_ulogic, mvl 4_ulogic)

RESOLVED SIGNALS package body mvl 4 is type table is array(mvl 4_ulogic, mvl 4_ulogic) of mvl 4_ulogic; constant resolution_table : = ((‘X’, ’X’, ’X’), (‘X’, ’ 0’, ’X’, ’ 0’), (‘X’, ’ 1’, ’ 1’), (‘X’, ’ 0’, ’ 1’, ’Z’)); function resolve_mlv 4(contribution : mlv 4_ulogic_vector) return mvl 4_ulogic is variable result : mvl 4_ulogic : = ‘z’; begin for index in contribution’range loop result : = resolution_table(result, contribution(index)); end loop; return result; end function resolve_mvl 4; end package body mvl 4;

RESOLVED SIGNALS Composite resolved subtypes: The following example shows a package interface and body

RESOLVED SIGNALS Composite resolved subtypes: The following example shows a package interface and body that define a resolved array subtype. Each element of an array value of this subtype can be ‘X’, ’ 0’, ’ 1’ or ‘Z’. The resolved type uword is a 32 element value of these values. package words is type x 01 z is (‘X’, ’ 0’, ’ 1’, ’Z’); type uword is array (0 to 31) of x 01 z; type uword_vector is array(natural range <>) of uword; function resolve_word(contribution : uword_vector) return uword; subtype word is resolve_word uword; end package words;

RESOLVED SIGNALS package body words is type table is array(x 01 z, x 01

RESOLVED SIGNALS package body words is type table is array(x 01 z, x 01 z) of x 01 z; constant resolution_table : = ((‘X’, ’X’, ’X’), (‘X’, ’ 0’, ’X’, ’ 0’), (‘X’, ’ 1’, ’ 1’), (‘X’, ’ 0’, ’ 1’, ’Z’)); function resolve_word (contribution : uword_vector) return uword is begin for index in contribution’range loop for element in uword’range loop result(element) : = resolution_table(result(element), contribution(index)(element)); end loop; return result; end function resolve_word; end package words;

RESOLVED SIGNALS The next example shows an entity declaration for a bus module that

RESOLVED SIGNALS The next example shows an entity declaration for a bus module that has a port of the unresolved type std_ulogic for connection to such a synchronization control signal. The architecture body for a system comprising several such modules is also outlined. library ieee; entity bus_module is port(synch : inout std_ulogic. . . ); end entity bus_module; architecture top_level of bus_based_system is signal synch_control : std_logic; begin synch_control_pull_up : synch_control <= ‘H’; bus_module_1 : entity work. bus_module(behavioral) port map(synch => synch_control. . ); bus_module_2 : entity work. bus_module(behavioral) port map(synch => synch_control. . ); . . . . end architecture top_level;

RESOLVED SIGNALS The next example is an outline of a behavioral architecture body for

RESOLVED SIGNALS The next example is an outline of a behavioral architecture body for a bus module, showing use of the synchronization control port: architecture behavioral of bus_module is begin behavior : process is. . . begin synch <= ‘ 0’ after Tdelay_synch; . . synch <= ‘Z’ after Tdelay_synch; wait until synch = ‘H’; . . end process behavior; end architecture behavioral;

RESOLVED SIGNALS

RESOLVED SIGNALS

RESOLVED SIGNALS This figure shows the hierarchical organization of a single board computer system

RESOLVED SIGNALS This figure shows the hierarchical organization of a single board computer system consisting of a video display, an input/output controller, a CPU/memory section and a bus expansion block. The CPU consists of memory block and a cache block. Both these act as sources for the data port, so it must be a resolved port. The cache has 2 sections, both act as its sources. Hence, this is also a resolved port.

RESOLVED SIGNALS • Consider a case of one of the cache sections updating its

RESOLVED SIGNALS • Consider a case of one of the cache sections updating its data port. The new driving value is resolved with the current driving value form the other cache section to determine the driving value of the CPU/cache block data port. This result is then resolved with the current driving value of the memory block to determine the driving value of the CPU/memory section. • Next, this driving value is resolved with the current driving values of the other top level sections to determine the effective value of the data bus signal. • The final step is to propagate this signal value back down the hierarchy for use as the effective value of each of the data ports. • Thus, a module that reads the value of its data port will see the final resolved value of the data bus signal.