Exception Handling with Petri Net for Digital Systems Wagner Luiz Alves de Oliveira DSIF/FEEC/Unicamp, Brazil wagner@dsif.fee.unicamp.br Norian Marranghello DCCE/Ibilce/Unesp, Brazil norian@dcce.ibilce.unesp.br Furio Damiani DSIF/FEEC/Unicamp, Brazil furio@dsif.fee.unicamp.br Abstract Petri net is a language for system modeling. Petri net extensions achieve a wide range of applications, such as: communication protocols, programming languages, computer architectures, distributed systems, industrial process control. These extensions allow the description of parallel systems, which can be simulated at the temporal, logical, and functional levels with reasonable simplicity. Such extensions have some limitations when describing digital systems. This paper presents an extension to overcome the existing limitations. Emphasis is provided about PNDS mechanisms aimed at exception handling. 1. Introduction Digital system design has reached a high degree of complexity that prevents its realization without CAD tools. Several specification languages were developed to capture as many hardware characteristics as possible. In this context, Petri nets have shown to be an effective modeling methodology for discrete event systems, due to the existence of a set of Petri net related techniques for dynamic and structural analysis. These techniques allow the formal validation of important properties of the model, such as: liveness (deadlock-freeness), safeness, boundedness. From the study about the use of Petri net extensions in digital system design [1], we could verify that none of them meets all desirable characteristics of a good modeling language. We propose a new Petri net extension to overcome these limitations. This extension is described in section two; section three shows its exception handling mechanisms; section four presents conclusion as well as studies in development. 2. A Petri net for digital system modeling Further dynamic and structural analysis techniques mentioned in introduction, Petri net extensions present most of the features needed for a good digital system modeling methodology as stated by Gajski et al. [2]: concurrency, state transitions, timing, programming constructs, hierarchy, behavioral completion, process synchronization, communication, and exception handling. Place Chart Nets (PCN [3]) and Petri Nets for Embedded Systems (PNES [4]) are Petri net extensions that present most of these features. PCN is a low-level extension, hierarchical, with preemptive mechanisms, but it lacks timing and programming constructs. PNES has hierarchy, programming constructs and preemptive mechanisms (it lacks interruptive mechanisms), but cannot be classified as high-level Petri net due to its boolean tokens, each of which can either be associated to holding the behavior of a circuit or not. Finally, both time for communication and time for computation have not been simultaneously treated in Petri net extensions. In this context, the authors have developed an extension called Petri Net for Digital Systems (PNDS). The main features of PNDS can be so stated: a) High-level description. Three kinds of places allow to model system components (storage and functional) as well as their local states. Tokens can represent the contents of a cell (at a storage unit), the status (data value) of a system component, or a data item related to an ordered list (data sample) to be processed by a behavior associated to a functional component. Transitions allow both to change modes (through removing/adding tokens from/to places assigned to local states or behaviors) and to perform read/write operations on data values (tokens) belonging to places assigned to storage elements. Special branches are adopted according to the places to which they are connected. Branch related expressions define what or how many tokens must be inserted, removed, read, or written on the assigned places; b) Hierarchy. Models deal with multiple process in the same structure. There exists one hierarchical instance (copy of behavior) for each complete data sample (ordered list of tokens) present in a functional place; c) Programming constructs. Place related constructs model system inherent data manipulation, while transition related constructs represent control flow manipulation; d) Full exception handling. Preemptive mechanisms allow to abort behaviors/local states assigned to a place,