quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bullet_green_ball.gif Introduction to Events

The e language provides temporal constructs for specifying and verifying behavior over time. All e temporal language features depend on the occurrence of events, which are used to synchronize activity with a simulator and within the e program.

   

space.gif

  • If a path is provided, use the event defined in the struct instance pointed to by the path.
  • If no path is provided, the event is resolved at compile time. The current struct instance is searched.
  • If the event instance is not found, a compile-time error shall be issued.
   

space.gif

An event named "clk" is defined to be the rising edge of a signal named "top.clk" at another event named "sim". The @ symbol is used with an event name, @event, to mean "when the event is true". The special @sim syntax means at a callback from the simulator. The rise() expression always causes a callback when the signal rises. Therefore, this event definition means "a rise of top.clk causes clk to occur". Occurrences of the "clk" event are represented by arrows.

   

space.gif

../images/specman/clk_rise_event.gif
   

space.gif

  ../images/main/bulllet_4dots_orange.gif Defining and Emitting Named Events

Events are defined as a part of a struct definition. When a struct is instantiated, each instance has its own event instances. Each event instance has its own schedule of occurrences. There is no relation between occurrences of event instances of the same type. All references to events are to event instances. The scoping rules for events are similar to other struct members, such as fields.

   

space.gif

Events can be attached to temporal expressions, using the option is [only] temporal-expression syntax, or they can be unattached. An attached event is emitted automatically during any tick in which the temporal expression attached to it succeeds.

   

space.gif

Syntax

Cause of Event

event a is (@b and @c)@d

Derived from other events.

event a is rise ('top.b') @sim

Derived from behavior of a simulated device.

event a is { @b; @c; @d }@e

A sequence of other events.

event a; meth_b() @c is { ... ; emit a; ... };

By the emit action in procedural code (see "emit").

   

space.gif

You can use the emit action in any method to cause an event to occur, whether it has an attached temporal expression or not. The simplest usage of emit is to synchronize two TCMs, where one TCM waits for the named event and the other TCM emits it. Emitting an event causes the immediate evaluation of all temporal expressions that contain that event.

   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example - Defining and Emitting Named Events
   

space.gif


  1 <'
  2 struct eventEmit {
  3   event clk is rise('top.clk') @sim;;
  4   event nclk is fall('top.clk') @sim;
  5   event startSim;
  6 
  7   mainInit()@clk is {
  8    // Do something here
  9    wait [1] *cycle; 
 10    // Emit event
 11    emit startSim;
 12    // Do something here
 13   };
 14 };
 15 '>
You could download file events_temp_ex1.e here
   

space.gif

  ../images/main/bulllet_4dots_orange.gif Sampling Events Overview

Events are used to define the points at which temporal expressions and TCMs are sampled. An event attached to a temporal expression becomes the sampling event for the temporal expression. The event is attached using the @sampling-event syntax:

   

space.gif

temporal-expression @sampling-event

   

space.gif

The temporal expression is evaluated at every occurrence of the sampling event. The sampling period is the time from after one sampling event up to and including the next sampling event. All event occurrences within the same sampling period are considered simultaneous. Multiple occurrences of a particular event within one sampling period are considered to be one occurrence of that event.

   

space.gif

  ../images/main/bulllet_4dots_orange.gif Predefined Events Overview

Predefined events are events which are already defined in e language, they get emitted at pre defined point of time.

   

space.gif

sys.any

Emitted on every tick.

sys.tick_start

Emitted at the start of every tick.

sys.tick_end

Emitted at the end of every tick.

session.start_of_test

Emitted once at test start.

session.end_of_test

Emitted once at test end.

struct.quit

Emitted when a struct's quit() method is called. Only exists in structs that contain events or have members that consume time (for example, time-consuming methods or on struct members).

sys.new_time

In stand-alone operation (no simulator), this event is emitted on every sys.any event. When a simulator is being used, this event is emitted whenever a callback occurs and the attached simulator's time has changed since the previous callback.

   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com