r_delay_in_lhs.od 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # We look for a Delay-block, its inport connected to an outport that has a signal
  2. delay:RAM_Delay
  3. delay_inport:RAM_InPort
  4. delay_has_inport:RAM_hasInPort (delay -> delay_inport)
  5. some_outport:RAM_OutPort
  6. delay_in_conn:RAM_link (some_outport -> delay_inport)
  7. in_signal:RAM_Signal {
  8. # If the signal is already equal to the state, don't match:
  9. # (without this, the rule could keep firing)
  10. RAM_x = `get_value(this) != get_slot_value(matched('state'), 'x')`;
  11. }
  12. port_in_signal:RAM_hasSignal (some_outport -> in_signal)
  13. # State of Delay block... (will be updated in RHS)
  14. state:RAM_State {
  15. # Attention: you MUST match the existing attribute, in order to force an UDPATE of the attribute, rather than CREATION
  16. RAM_x = `True`;
  17. }
  18. delay_to_state:RAM_delay2State (delay -> state)
  19. # Only update Delay block state IF after its output signal has been computed:
  20. delay_outport:RAM_OutPort
  21. delay_has_outport:RAM_hasOutPort (delay -> delay_outport)
  22. out_signal:RAM_Signal
  23. delay_out_signal:RAM_hasSignal (delay_outport -> out_signal)