Next Article in Journal
Analysis of the Effect of Vegetable Broth Addition to a Gelatin Pork Edible Film and Coating Method on Select Physical Properties of Freeze-Dried Coated Vegetable Bars
Next Article in Special Issue
Optimized Sequential State Encoding Methods for Finite-State Machines in Field-Programmable Gate Array Implementations
Previous Article in Journal
A Reinforcement Learning Approach to Dynamic Trajectory Optimization with Consideration of Imbalanced Sub-Goals in Self-Driving Vehicles
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design and Optimization of a Petri Net-Based Concurrent Control System toward a Reduction in the Resources in a Field-Programmable Gate Array

by
Remigiusz Wiśniewski
1,2,
Adam Opara
2,3,* and
Marcin Wojnakowski
2
1
Department of Digital Systems, Silesian University of Technology, Akademicka 2A, 44-100 Gliwice, Poland
2
Institute of Control and Computation Engineering, University of Zielona Góra, Prof. Z. Szafrana 2, 65-516 Zielona Góra, Poland
3
Department of Graphics, Computer Vision and Digital Systems, Silesian University of Technology, Akademicka 2A, 44-100 Gliwice, Poland
*
Author to whom correspondence should be addressed.
Appl. Sci. 2024, 14(12), 5212; https://doi.org/10.3390/app14125212
Submission received: 12 May 2024 / Revised: 6 June 2024 / Accepted: 12 June 2024 / Published: 15 June 2024
(This article belongs to the Special Issue Current Updates of Programmable Logic Devices and Synthesis Methods)

Abstract

:

Featured Application

The proposed research method is strictly aimed at further practical applications. The authors present the design technique aimed at the effective implementation of the modeled concurrent control system within the FPGA device. The main goal is the reduction in the logic resources of the destination FPGA by adequate modeling and optimization of the system. The proposed idea is illustrated by a real-life application of the photovoltaic control system implemented in the FPGA device from Xilinx (Artix-7 family).

Abstract

A novel design technique of a Petri net-based concurrent control system is proposed in this paper. The idea is oriented on the effective implementation of the system within the FPGA device. In order to reduce the resources of the targeted device, the concurrent control system is optimized by the use of the authors’ techniques. The complete design flow is shown, including the modeling of the system by an interpreted Petri net, its further transformation to the hardware description language, adequate logic optimization, and final implementation within the destination FPGA. The presented method is explained by a case study example of the photovoltaic control system and compared with the already known technique. The performed experiments indicated a very high effectiveness of the proposed technique. It is shown that the photovoltaic control system designed according to the presented method reduces the logic resources of the destination FPGA device by up to 28%.

1. Introduction and Problem Formulation

Petri nets, a versatile and powerful formal modeling tool, have been instrumental in advancing the design process of control and complex systems [1]. Originally introduced by Carl Adam Petri in 1962, Petri nets provide an intuitive graphical representation for describing and analyzing the dynamics of concurrent systems [2]. Over the years, Petri nets have found widespread applications in various domains, including computer science [3], manufacturing [4,5,6], biology [7], and cyber-physical systems [8]. Recently, the Petri net-based modeling approach has become especially popular in the modeling of real-life industrial systems (e.g., they are applied by manufacturing companies) [9,10,11].
The main advantage of Petri nets lies in their simplicity and graphical formal representation, which can be constructed relatively very easily. In addition, a Petri net can also be considered as a mathematical modeling framework that reflects the behavior of systems through the directed bipartite graph. Such a graph consists of places and transitions that are connected by directed arcs [12]. A place is active (marked) if it contains a token. Places that are marked at the same time represent states (markings). Furthermore, transitions reflect actions in a system. In particular, a transition may fire, by removing tokens from all its input places and relocating them to all its output places. Consequently, such an action changes the state in the system [13]. Furthermore, tokens may be used to model resources of the system elements [14] or indicate a logical behavior of the system [13,15]. Finally, Petri nets are heavily supported by formal analysis techniques [1,16,17,18]. There exist methods that allow for verification (sometimes even validation) of the system at the early specification stage. Such a combination of graphical and mathematical approaches makes Petri nets an intuitive and comfortable tool for the modeling, analysis, and verification of systems that strongly utilize concurrency [19,20].
Moving on to the concurrency aspects, it should be emphasized that Petri nets reflect such a relation by their nature [21]. In particular, one or more places can be marked at the same time. It means that operations associated with those places are executed concurrently. This makes Petri nets applicable in many areas of human life, especially including industry applications [22]. For example, they can be found in modern industries, such as resilient manufacturing, where 3D printing techniques are applied [23]. It should also be noted that Petri nets provide a robust means of modeling the intricate interactions and dependencies in such systems, allowing for a detailed examination of their behavior [24].
On the other hand, the modeled concurrent system ought to be carefully examined against possible errors and designer mistakes. Systems that involve concurrency are exposed to serious risks, including deadlocks or an infinite number of states (if wrongly designed). There are two fundamental properties of Petri nets that are related to the above mentioned problems: liveness and boundedness [25]. The first one, liveness, guarantees that a system can reach any desirable state under certain conditions (formally after a final firing sequence), ensuring that the system remains responsive and operational at all times [26]. Furthermore, boundedness implies that the number of tokens in a Petri net does not exceed predefined limits in each place, preventing uncontrolled behavior or resource depletion [27]. An unbounded Petri net with those specification assumptions could lead to uncontrolled behavior [28]. Such a condition can be defined more strictly. There exist Petri net systems that are required to be 1-bounded (safe) [29]. This means that in each place, in any state, there can be at most only one token. This restriction is especially useful in the case of binary control systems, where safeness assures the accurate logical behavior of the system [30,31].
Let us move on to the interpreted Petri nets. Such a class is an extension of the ordinary Petri nets; however, they additionally contain input and output signals that permit communication with the environment [6,13,32]. These extensions can capture real-world phenomena, such as reading from sensors or activating tasks [33]. Input (logical) signals are associated with transitions while outputs are assigned to places [11]. In the interpreted Petri net, a transition must additionally fulfil a logical equation of its input signals to be fired. This is an extended rule of an ordinary Petri net, where the firing of a transition requires a token at all input places only. However, this rule can be considered as a great advantage of interpreted Petri nets, since input signals may be used to resolve conflicts in non-free choice nets [13]. In short, a conflict in a Petri net corresponds to a non-deterministic situation, where two or more transitions may be fired. Therefore, such input signals may resolve conflicts very easily and comfortably. Finally, output signals are associated with places. Usually, they represent operations executed by the Petri net-based system. Sometimes, such signals can also trigger (activate) associated tasks especially in management systems [5]. In conclusion, it should be noted that interpreted Petri nets are live and bounded (or safe) by their definition. This is a huge advantage of this class, since the described system is assured to be absent of deadlocks and to have a finite number of states. On the other hand, such an excessive demand requires a solid examination of the system at the early prototyping stage.
Finally, let us briefly introduce Field-Programmable Gate Arrays (FPGAs) and relate them to Petri nets. In general, an FPGA is a hardware device that can be reprogrammed in order to perform specific logic operations. A typical FPGA consists of logical blocks whose core is a look-up table (LUT) [34]. LUTs are in charge of the realization of combinational logic (usually up to 5–6 variables). Furthermore, FPGAs include flip-flops to perform sequential operations. Due to their flexibility, and high performance, FPGAs have found applications in a multitude of industries, including aerospace, automotive, and telecommunications [35,36]. It is worth noting that advanced FPGA platforms allow for dynamic partial reconfiguration [37,38,39]. This allows for changing the behavior of a part of the system without turning off the device. Thus, it has found application in special critical fields such as Mars missions [40]. Leveraging Petri nets to model control systems, especially when targeting FPGA implementation is beneficial also due to their concurrent nature [41]. It should be underlined that both—Petri nets and FPGAs—are concurrent by nature. Contrary to the sequential systems, where particular operations are performed in sequence, concurrent systems allow for simultaneous operations at the same time. Therefore, FPGAs seem to be an excellent destination for the implementation of Petri-net based systems [13,42,43].
In general, the implementation of the Petri net-based concurrent system within FPGA is a relatively easy process. The modeled system is transformed to the hardware description language (HDL), which is a base for further realization within the FPGA. In short, the functionality of particular places and transitions of a Petri net are translated into the set of equations that are written within the hardware language Verilog or VHDL (Very High Speed Integrated Circuit Hardware Description Language) [44]. Going into detail, each place of a Petri net is assigned to one flip-flop in a sequential circuit [13]. Thus, a set of flip-flops active at the same time reflect the current marking (state) of the system. Similarly, transitions are transformed into logical functions (combinational circuit) [43]. Those functions stimulate flip-flops associated with places. Finally, output signals are directly assigned to the particular places [13,43]. The technique described above is effective (the translated system reflects the model) and relatively easy to perform (the transformation can be conducted automatically), thus it seems to be the most popular nowadays. However, there is an important drawback that refers to the relatively high utilization of hardware resources of an FPGA. As already mentioned, an FPGA consists of LUTs and flip-flops (FFs). Although a single LUT allows for the implementation of any logic function, it is limited to a relatively small number of variables (usually 5–6). This means that larger functions ought to be divided (decomposed) into subfunctions with a small number of variables [45,46,47,48]. Obviously, such a decomposition heavily influences the number of logic blocks used to implement the modeled system. Therefore, the final implementation of the Petri net-based design may drastically increase. Let us now briefly overview the most popular logical function decomposition techniques of systems implemented within an FPGA.
The first decomposition algorithms were developed in the 1990s and they were initially oriented on the optimization of the gate structures (with further adoption to FPGAs). These methods include the MIS-PGA, ASYL, Chortle, and Xmap algorithms. Their essence was to optimize the multi-level implementation of logical functions. Later, as a result of the development of decomposition methods, tools such as Demain [49], FGsyn [50], and Decomp [51] were developed. Those techniques are based on the classical decomposition model [52], and they provide efficient solutions (in terms of the number of logic blocks or the number of layers), but their main drawback is high computational complexity. Therefore, the optimization possibilities of complex circuits were highly limited, since the long synthesis time made them difficult to use in practical approaches. In the 2000s, plenty of academic tools appeared, together with the representation of logic functions in the form of And-Inverter Graphs (AIGs). Such a graph can be found, for example, in the ABC [53] and DAOmap [54] systems. Meanwhile, the re-synthesis techniques were developed [55,56], benefiting systems such as the Delay-Driven BDD (DDBDD) [57] and BDS-PGA 2.0 [58], which use Binary Decision Diagrams (BDDs) to represent logical functions. Furthermore, development of technology and the expansion of logic blocks in the programmable circuits resulted in the appearance of tools that permit the configuration of logic blocks, e.g., ALMmap [59].
Getting back to the current times, there is no doubt about the importance of decomposition in logical synthesis. Such a process is a subject of extensive research in the context of synthesis dedicated to FPGAs and Programmable Array Logic (PAL)-based systems [60]. Decomposition is also used in the synthesis process oriented to Complex Programmable Logic Devices (CPLDs) [61,62,63]. In logical synthesis algorithms, the way in which a logical function is represented is especially important. Functions can be represented in the form of a table description [52], cube description, and graph description. Nevertheless, methods that utilize BDDs [57,64] are of great interest. The achievements of Ashenhurst and Curtis laid the foundations for subsequent types of decomposition, but memory-inefficient decomposition tables (Karnaugh tables) were used to represent the logical functions. Looking from the terms of memory consumption, a much better solution is the BDD representation [57,58,65]. The description of logical functions in the form of BDD leads to the significant reduction in computer memory and better speed performance of operations on these functions. Moreover, a dozen standard libraries for manipulating BDDs are available. To be precise, the reduced and ordered form of BDD (ROBDD) is used. These advantages have led to the development of tools such as BDS or DDBDD and MultiDec [66] that lead to effective solutions. Good solutions are also provided by mentioned tools such as DAOmap or ABC [67], which use AIGs. The newest academic synthesis tools of industry-standard strength are coupled with HDL compilers [67,68,69]. The latest algorithms also combine the advantages of AIG manipulation [69] and the representation of functions in the form of BDD [70]. There are also many approaches to the use of BDD that allow for multiple output functions to be represented. The most popular forms of describing multi-output functions are shared BDD (SBDD) and multi-terminal binary decision diagram (MTBDD) [71]. In conclusion, it should be pointed out that there exist plenty of decomposition methods, aimed at various goals to be achieved. One of them is the minimization of the number of blocks [45,46,47,71,72], while others are focused on the optimization of the number of logical layers [66,73] or the reduction in the dissipated power [74,75,76,77]. Moreover, proper optimization strategies may target both combinational and sequential circuits [78,79]. Finally, the most important aspect lies in the adequate division of the system and effective decomposition of logic functions in order to reduce the number of utilized logic blocks (LUTs and FFs) of an FPGA.
To summarize the discussion above, the following research gaps can be noticed in the design and optimization of a Petri net-based concurrent control system oriented toward implementation within FPGA devices. Firstly, as designs become complex, using adequate effective modeling techniques becomes extremely important. The method proposed in this paper involves Petri nets, which are intuitive and comfortable modeling tools, joining the graphical and mathematical representation of the system. Another serious bottleneck in the design of concurrent control systems refers to the scalability of the concurrent systems. Therefore, this paper focuses on the reduction of logic resources to ensure efficient FPGA utilization. Such an optimization involves effective decomposition techniques which are crucial in the proposed techniques. In conclusion, in this work, a novel technique oriented toward the adequate modeling and design optimization of the Petri net-based concurrent control system is proposed. The main aim of the presented method is to reduce the number of utilized logic blocks (LUTs and flip-flops) of the destination FPGA device.
The main contributions are summarized as follows:
  • Proposition of a novel design technique of a Petri net-based concurrent control system oriented toward the reduction in the resources (logic blocks) of an FPGA. The presented prototyping flow applies an interpreted Petri net, and additionally permits conflict resolution in the modeled system;
  • Proposition of a novel optimization technique of the Petri net-based design. The method includes both the functional decomposition of the combinational part of the system and the optimization of the sequential part of the system;
  • Proposition of a photovoltaic control system as a case study of the presented prototyping flow. The applied system reflects the real-life concurrent control system further optimized and implemented within the FPGA device.
  • Experimental verification of the proposed technique and comparison to the existing functional decomposition methods from the literature.

2. The Proposed Design Method of Petri Net-Based Concurrent Control System Oriented toward a Reduction in FPGA Resources

This section presents the novel designing technique of Petri net-based concurrent systems aimed at the reduction in the resources of the destination device. The description is divided into four main parts and the whole process is shown in the form of flowchart in Figure 1. Firstly, the modeling rules of Petri net-based concurrent systems are presented. This subsection is supplemented by the main definitions and preliminaries related to the presented method. Subsequently, a transformation method of the Petri net-based model to the Verilog hardware language is explained. Such a description is an input for the proposed reduction (decomposition) technique. Finally, the implementation aspects of the modeled system within an FPGA are explained.

2.1. Modeling of the Petri Net-Based Concurrent Control System

The first step in the presented design refers to the modeling of a system by an interpreted Petri net. Based on the informal description of the concurrent control system, a Petri net-based specification is created. In order to present the proposed Petri net-based modeling technique, let us firstly define the main notations related to the discussed topic [1,12,13,27,80,81].
Definition 1.
A Petri net is a 4-tuple   N = P , T , F , M 0   with   P = p 1 , , p n   as the finite set of places,   T = t 1 , , t m   as the finite set of transitions,   F P × T T × P   as the finite set of arcs, and   M 0   is the initial marking.
Definition 2.
A marking of a Petri net   N = P , T , F , M 0   assigns to each place a nonnegative integer   M : P . A marking can be considered as a distribution of tokens in the Petri net places. A marked place contains at least one token.
Definition 3.
A transition   t T   is enabled in marking   M   if each of its input places contains at least one token. An enabled transition   t   is fired (with exception of Definition 7, which is valid for interpreted Petri nets). The firing of a transition   t   changes the marking from   M   to   M   by removing a token from each of the input places of   t , and it adds a token to each output place of   t . A marking   M   is reachable if it can be obtained from the initial marking   M 0   by a sequence of transition firings.
Definition 4.
A Petri net   N   is safe if for every reachable marking   M   and every place   p P  :   M p 1 .
Definition 5.
A Petri net is live if from any marking of a Petri net it is possible to fire any transition in the net by a sequence of firings of other transitions.
Definition 6.
An interpreted Petri net is a live and safe Petri net   N =   P , T , F , M 0 ,   X ,   Y , where   X = x 1 , ,   x o   is a finite set of input signals and   Y = y 1 , ,   y p   is a finite set of output signals. Such a net is required to be safe and live to fulfil the implementation assumptions in FPGAs (see the next subsection for more details and examples).
Definition 7.
A transition   t T     of interpreted Petri net   N =   P , T , F , M 0 ,   X ,   Y   is fired when and only when it is enabled, and all its input signals (from the set X) are fulfilled. The firing of a transition changes the marking in the same way as it is shown in Definition 3.
The main benefit of Petri nets is the possibility of easy representation of concurrency, but sequential processes can be expressed naturally and intuitively. Let us explain it by an example. Consider a concurrent control system shown in Figure 2. There are   P =   10 places and   T = 10    transitions in the system specified by an interpreted Petri net   N 1 . Moreover, there are   X = 6    input binary signals,   X = s , e 1 , e 2 ,   x 1 , x 2 , x 3 , and   Y = 5    output binary signals assigned to transitions and places, respectively. Let us briefly describe the behaviour of the system. At the beginning, three places are initially marked:   p 3 ,   p 5 , p 6 .   This means that three processes are performed concurrently. In particular, operations   y 2   and   y 3   are executed (related to places   p 5   and   p 6 , respectively), while the third process waits until those operations are finished. The first one (  y 2 ) is dependent on input signal   e 1 . Once this signal becomes active, transition   t 2   is fired and the token is moved from   p 5   to   p 2 . Similarly, input signal   e 2   allows for firing   t 4   and moving a token from   p 6   to   p 4 . Note that both operations (  y 2 ,   y 3 ) are typically concurrent, while they may (but not have to) occur at the same time. Once the system reaches a state with marked places   p 2 ,   p 3 ,     p 4 , transition   t 3   is fired. Note that there are no input signals assigned to   t 3 , thus it is fired once all its input places contain a token. As the consequence, tokens from all input places of   t 3   (that is, from places   p 2 ,   p 3 ,   p 4 ) are consumed and added to each of its output places:   p 5 ,   p 6 , and   p 7 . In such a resulting state, three tasks are executed concurrently. Two of them refer to operations   y 2   and   y 3 , as it was already described (during the initial marking). The remaining process is related to place   p 7 . Depending on the combination of input signals   x 1 ,   x 2 ,   x 3 , three possible places can be reached by this particular process:   p 1   (upon firing of   t 5 ),   p 8   (when   t 6   is fired), or   p 9   (upon firing of   t 7 ). Note that the input signals here play an essential role and allow for enabling the particular transition. In general, Petri nets are not deterministic, and such a situation is called a conflict [41,43,82]. Such a problem can be easily resolved by application of the input binary signals—this is one of the additional (and huge) benefits of interpreted Petri nets. Finally, the system executes operation   y 1   (if   t 5   is fired),   y 4   (  t 6 ), or   y 1 ¯   (  t 7 ). The first possibility returns to   p 7   (once input signal   s   becomes active and transition   t 1   is fired), while the remaining two eventually lead to the initial state, where place   p 3   is marked.
The concurrent control system presented in Figure 2 illustrates the power of Petri net-based specification. There are several tools that support the modeling of Petri net-based systems. A graphical specification of a model can be prepared for instance within Input Output Place Transition-Tools v 1.2 (IOPT-Tools) [83] or Platform Independent Petri net Editor 2.5 (PIPE) [84]. Moreover, the model of the system can be easily examined [20] (initial verification) and even validated (simulated). The concurrent control system described by interpreted Petri net   N 1   is live and safe. This means that each transition of the net can be reached (by a sequence of firing of other transitions). Moreover, there is at most one token at any place (in each reachable state) in the system. Such a verification (of liveness and safeness) can be performed within the modeling tools (e.g., PIPE). However, in the case of more complex concurrent control systems, advanced methods and tools can be applied, such as Hippo [19,20,29,31], GreatSPN [85], and IOPT-Tools [19,83,86,87].

2.2. Transformation of the Petri Net-Based Description into Verilog HDL Code

In order to implement the Petri net-based system within an FPGA, the model ought to be transformed from the graphical notion into the hardware description language. There exist several techniques that allow for such a transformation. In this paper, we follow the technique shown in previous authors’ works [13,41,43], while as a hardware language, Verilog HDL is applied. Note that such a description is essential for further functional reduction (described in the next subsection).
In general, the method is based on the description of the behavior of the system. The Verilog model consists of three main blocks. The first one refers to the transitions; the second represents the states (concurrently marked places); while the remaining one is related to the binary outputs of the Petri net-based concurrent control system. Let us describe each of them in detail.
The behavior of transitions is described by logical equations. Each equation is formulated as a logical conjunction of input places and conditions of a particular transition. From the technical point of view, continuous assignments (assign statements) are applied. Listing 1 shows the equations for the concurrent control system specified by   N 1 . There are ten transitions in the presented interpreted Petri net. Each assignment corresponds to the logical condition that enables a particular transition. For example, the first line continuously assigns a logical expression: p[1]&s to transition   t 1 . This means that transition   t 1   is enabled if two conditions are fulfilled: (1)   p 1   is marked (contains a token), and (2) the input signal   s   is active (high value). Another line (3) assigns a logical condition p[2]&p[3]&p[4] to t[3], which means that transition   t 3   is enabled when all three of its input places (  p 2 ,   p 3 ,   p 4 ) contain tokens.
Listing 1. Transition equations for the concurrent control system modeled by   N 1 .
Applsci 14 05212 i001
States (markings) of the system are represented by the procedural assignments, within the always block. Such a description involves equations for places of the interpreted Petri net. In the proposed solution, each place is represented by a single register. Therefore, markings simply refer to the set of active registers (places), in exactly the same manner as in the case of the Petri net-based model. The switching of markings depends on the active transitions (that are fired); thus, the equation for each place includes a function of its input transitions.
The Verilog description of states (places) for the concurrent control system specified by   N 1   is shown in Listing 2. It is assumed that the system is oscillated by a clock signal (denoted as clk). Moreover, there is an asynchronous reset signal that zeroes the system (that is, resets to the initial marking). There are ten places in the presented interpreted Petri net. The first statement (line 3) in the presented listing refers to zeroing the system to the initial state. Simply, if the reset signal is active, the binary value 0010110000 corresponding to the initial marking is assigned to the vector p. Note that reset is asynchronous, therefore it is activated despite the clock signal. Otherwise (that is, if reset is not active), each entry of the vector p is assigned by an equation according to the token distribution in particular places. For example, place   p 3   (line 8) is active (holds a token) if its output transition   t 3   is not enabled (by holding up the current state), or, if its input transition   t 10   is executed. Similarly, the description for place   p 7   involves the following: p[7]&~t[5]&~t [6]&~t[7]|t[1]|t[3]. This means that   p 7   becomes active if one of three conditions is fulfilled if either all its output transitions (  t 5 , t 6 , t 7 ) are not enabled or one of its input transitions (  t 1   or   t 3 )   is executed. Note that in the above descriptions, procedural assignments are used; thus, the values of particular places are registered. Such place registers strictly refer to the current state of the system.
Listing 2. Place equations for the concurrent control system modeled by   N 1 .
Applsci 14 05212 i002
The third block refers to the binary outputs of the system. The proposed description mixes continuous and procedural assignments, according to the designer’s needs. Typically, continuous assignments are used. Such a situation is more common when the modeled system controls objects by sending signals. However, outputs can be also registered in order to maintain the value. This can be especially useful if the particular output should be activated in the particular state and deactivated with the other marking. Recall Petri net   N 1 . Output   y 1    is activated by place   p 1   and deactivated by   p 9 . Therefore, this particular signal is described by procedural assignment, as shown in Listing 3 (lines 1–7). All the remaining outputs are described by continuous assignments [41,43].
Listing 3. Output equations for the concurrent control system modeled by   N 1 .
Applsci 14 05212 i003
It should be noted that the transformation process can be automated. There exist tools that permit the conversion of a Petri net-based description to hardware description languages, either VHDL (e.g., IOPT-Tools [83]) or Verilog (e.g., Hippo tool [19,20,88]). Therefore, the designer is not forced to know technical details nor advanced mechanisms in regard to the particular hardware language.
To conclude the discussion presented above, let us underline that the HDL model is essential for the further functional reduction (described in the next subsection). All three blocks included within Verilog code are based on the logic equations. Therefore, the adequate realization (implementation) of such functions within an FPGA is extremely important in the context of utilized logic blocks. The next subsection proposes a novel decomposition technique of logic equations. The main aim of the presented solution is the reduction in the FPGA resources.

2.3. Optimization of the Verilog HDL Code of the Concurrent Control System

This step consists of two main operations. The first one is related to the optimization of the sequential part of the system, while the second refers to the decomposition of logic functions (combinational part). Note that the presented technique is strictly tied with the presented modeling process and it assumes that the system utilizes the single clock domain (all the registers are oscillated by the same clock signal).

2.3.1. Optimization of the Sequential Part of the System (Redundant Sequential Logic Optimization)

Firstly, the logical equations written in Verilog ought to be transformed into a form that can be efficiently applied in the optimization process. In the proposed approach, the reduced ordered binary decision diagram is utilized (ROBDD, for simplicity called BDD) [89]. Such a graph permits the storage of logical functions in a memory-efficient manner.
Once the logical equations are transformed to a BDD, the optimization of the redundant sequential logic is performed. This process refers to searching for the equivalent parts of the design that can be reduced in order to minimize the amount of resources required for the implementation of the system within the FPGA device. Let us explain this by an example. Assume that there are two functions:   f 1 = x 1 + x 2   and   f 2 = x 1 x ¯ 2 + x 1 x 2 + x ¯ 1 x 2 . Those functions are equivalent, and   f 1 = f 2 . Therefore, the design can be optimized and only one of those functions is implemented in the hardware. In the case of the BDD, checking whether two functions are equivalent is relatively easy, and it just requires comparison of whether two pointers are equal. However, reduction of the number of flip-flops can be much more complicated. Consider an obvious example. Assume there are two flip-flops, controlled by the following functions:
D 1 = Q 3   x 1 + Q 3 ¯   x 2 D 2 = Q 3   x 1 + Q 3 ¯   x 2 + x 1 x 2
Both functions are equivalent:   D 1 = D 2 . What can be proved by algebraic transformations is as follows:
D 1 = Q 3   x 1 + Q 3 ¯   x 2 = Q 3   x 1   1 + Q 3 ¯   x 2   1 = Q 3   x 1 1 + x 2 + Q 3 ¯   x 2   1 + x 1 = Q 3   x 1 + Q 3   x 1 x 2 + Q 3 ¯   x 2 + Q 3 ¯   x 2 x 1 = Q 3   x 1 + Q 3 ¯   x 2 + Q 3 + Q 3 ¯   x 1 x 2 = Q 3   x 1 + Q 3 ¯   x 2 + 1   x 1 x 2   =   D 2
The same is immediately visible when using the BDD representation of Boolean functions (Figure 3a). In the computer implementation of libraries for operating on BDD (or more precisely ROBDD), the logical function is a pointer to a structure in the memory (representing a graph node) [89]. The structure contains two pointers to two descendants for the values of the variable 0 and 1. When performing any operation on a BDD, it is checked using a hash table to see if the node already exists in memory, so as not to duplicate it. BDD libraries ensure the canonicity of logical functions, i.e., unambiguity and uniqueness of representation. Checking if two functions are equal is limited to checking if two pointers are equal to each other.
Nevertheless, replacing the mentioned two flip-flops with a single one requires two conditions to be fulfilled. Firstly, their excitation functions ought to be the same. Furthermore, the initial values of both flip-flops must be the same:   Q 1 t = 0 = Q 2 t = 0   (which can be easily checked). The replacement of two flip-flops by a single one is shown in Figure 4a.
Another possibility refers to a hidden equivalence, where the excitation functions are not the same (Figure 4b), but the flip-flops could be reduced. Let us underline that commercial tools are not always able to optimize the number of registers. Therefore, in this paper, a novel reduction technique is proposed. Assume there are two flip-flops with the following excitation functions:
D 3 = Q 3   x 1 + Q 3 ¯   x 2 D 4 = Q 4   x 1 + Q 4 ¯   x 2
Clearly, the above functions are not equal. Moreover, they correspond to the different pointers in the BDD (Figure 3b). Finally, both functions   D 3 = f ( Q 3 ,   x 1 ,   x 2 )   and   D 4 = f ( Q 4 ,   x 1 ,   x 2 )   have different arguments. However, due to the fact that the system is oscillated by the same clock signal, they can be transformed into the equivalent form.
Let us explain this with an example. Assume that at time   t = 0   both flip-flops are initialized with the same value, e.g.,   Q 3 t = 0 = Q 4 t = 0 = 0 . Then, after inserting that into expression (2), we obtain the same functions   D 3 t = 0 = D 4 t = 0 = x 2 . Since at the moment   t = 0   the excitation functions of the flip-flops are equal, at the next moment   t = 1 , the Q values remain the same:   Q 3 t = 1 = Q 4 t = 1 . Furthermore, if both flip-flops are initialized by value   Q 3 t = 0 = Q 4 t = 0 = 1 , we obtain   D 3 t = 0 = D 4 t = 0 = x 1 , and thus   Q 3 t = 1 = Q 4 t = 1 . By repeating the above for every time moment t, it can be noticed that both flip-flops are equivalent.
For the general case, we formulated Theorem 1.
Theorem 1.
Two synchronous flip-flops   D k   and   D l   are described by Shannon expansion:
D k = Q k   f 1 k + Q k ¯   f 0 k D l = Q l   f 1 l   + Q l ¯   f 0 l
where   f 1 k = f Q 1 , ,   Q k = 1 ,   , Q n ,   x 1 , , x m   and   f 0 k = f Q 1 , ,   Q k = 0   , ,   Q n ,   x 1 , , x m   are equivalent if
(a) 
cofactor functions are equivalent,   f 1 k = f 1 l   and   f 0 k = f 0 l   ,
(b) 
initial values for both flip-flops are identical   Q k t = 0 = Q l t = 0 .
Proof of Theorem 1.
We show that for any time moment t, if   Q k t = Q l t   holds, then it implies that   Q k t + 1 = Q l t + 1 . Since the operation of D flip-flops can be described by   Q k t + 1 = D k t   and   Q l t + 1 = D l t , Equation (4) can be rewritten in the following form:
Q k t + 1 = Q k t   f 1 k + Q k t ¯   f 0 k Q l t + 1 = Q l t   f 1 l   + Q l t ¯   f 0 l
Inserting condition (a)   f 1 k = f 1 l   and   f 0 k = f 0 l   into Equation (5), we obtain the following:
Q k t + 1 = Q k t   f 1 l + Q k t ¯   f 0 l Q l t + 1 = Q l t   f 1 l   + Q l t ¯   f 0 l
If   Q k t = Q l t , we obtain   Q k t + 1 = Q l t   f 1 l + Q l t ¯   f 0 l = Q l t + 1 . Hence, if at time t = 0 (b)   Q k t = 0 = Q l t = 0   holds, it implies that   Q k t = 1 = Q l t = 1 . Similarly, if   Q k t = 1 = Q l t = 1   holds, it implies that   Q k t = 2 = Q l t = 2 , and so on, for every time moment t. □
Cofactors of a function can be obtained in a very efficient way from the BDD. For the flip-flops considered in our example, the BDD cofactors of   D 3   (versus   Q 3 ) and   D 4   (versus   Q 4 ) are shown in Figure 3b (corresponding schema in Figure 4c). If the order of variables in a BDD diagram is arranged in such a way that the root of the diagram is associated with the variable Q, then the child nodes constitute cofactors. To summarize, searching for equal cofactors can be conducted relatively easily with the BDD, effectively reducing the number of flip-flops.
Once the sequential part of the system is optimized, the decomposition of logic functions is executed. Such a process is a perfect supplement for the redundant sequential logic optimization and may strongly influence the utilized resources of an FPGA.

2.3.2. Optimization of the Combinational Part of the System (Decomposition of Logic Functions)

The main aim of the logic function decomposition is to reduce the number of LUT blocks of the destination device. Realization of the system within an FPGA imposes a limit on the number of variables of a single function. Therefore, if a function contains more variables than the number of inputs of the LUT block, it ought to be decomposed to make the implementation possible.
In general, the essence of the decomposition refers to the proper division of the system into blocks with a given number of inputs. The function of n-variables   f X ,   X = x 1 , x 2 , , x n   can be represented as   h g 1 X b , ,   g m X b ,   X f , where   X b   is the bound set and   X f   is a free set (  X = X b X f ), when the number of column patterns of the partition matrix is less than or equal to   2 m   [52]. The division of variables involves searching for the sets   X b   and   X f . If the common part of the sets   X b   and   X f   is empty, we say that the decomposition is disjoint.
Splitting the variables into two subsets is equivalent to making a cut in a binary decision diagram. The nodes above the cut line form a bound set, and those below are a free set. The nodes below the cut line that are pointed by the cut edges are called cut nodes. The number of cut nodes corresponds to the number of column patterns in the Ashenhurst–Curtis decomposition or the number of equivalence classes in the Roth–Karp decomposition [52]. In the general case, for n cut nodes,   log 2 n   bits are needed to distinguish them. Several functions gi are then created,   i = 1 , , log 2 n . The number of cut nodes depends on the choice of variables that create the free and bound set, i.e., on the order of variables in the graph and on the level at which the cut will take place. When looking for a decomposition allowing the implementation of the circuit using k-input LUT blocks, the cutting level is usually set to k, counting from the root of the diagram.
Let us explain the decomposition by an example. Assume a function of four variables   f x 1 , x 2 , x 3 , x 4   to be realized within a LUT3 block (k = 3). Since the number of variables (four) exceeds the number of available inputs of the LUT (three), the function ought to be decomposed. Figure 5 illustrates the decomposition process. Firstly, the BDD is cut off below the third level of nodes counting from the root (Figure 5a). The bound set is formed by variables   { x 1 ,   x 2 ,   x 3 } , and free set by   { x 4 } . There are four cut nodes a, b, c, and d. To encode four patterns,   log 2 4 = 2   bits are required (two g functions:   g 1   and    g 2 ). The encoding of cut nodes by   g 1 , g 2   functions is shown in Figure 5b,   g 1 , g 2   = 00-a, 01-b, 10-c, 11-d, which means that two new functions   g i x 1 , x 2 , x 3   are created. Replacing the upper part of the BDD for function f (variables marked in green in Figure 5a) with newly created   g i   functions gives diagram   h x 4 , g 1 , g 2 , which is presented in Figure 5c (h is functionally equivalent to f).
Furthermore, the   g i   functions define the bound block of the partitioned circuit (Figure 5d), and the free block is defined by h. The number of inputs of both obtained blocks does not exceed three; thus, the system can be implemented within a three-input LUT block. This means that the aim of the decomposition has been achieved.
The above example shows the general idea of the decomposition technique applied in this work. However, in practice, the number of variables very often significantly exceeds the number of LUT inputs. In such a case, the decomposition steps are iteratively repeated.
Figure 6 illustrates such a situation. There are six arguments in the initial function that are going to be realized with three-input LUTs. The first step of the decomposition is similar to the previous example. The diagram of function f is cut off below the third level of nodes, as shown by green dashed line in Figure 6a.
Four cut nodes a, b, c, and d are encoded with two functions   g 1 , g 2 . The upper part of the diagram with variables   { x 1 ,   x 2 ,   x 3 }   is replaced with nodes associated with   g 1 , g 2 , and it forms a new diagram   h 1 g 1 , g 2 , x 4 , x 5 , x 6   (Figure 6c). The   h 1   function still has too many variables to implement with LUT3 blocks; thus, another round of decomposition is performed. This time, the diagram is cut below nodes associated with   x 4   (Figure 6c). Below the magenta dashed line, there are only two cut nodes a and c, and just a single   g 3   function is necessary to distinguish them (Figure 6d). By replacing the upper part of diagram   h 1   (variables   { g 1 ,   g 2 ,   x 4 } ) with   g 3   once more, the   h 2   diagram is obtained (Figure 6e). The resulted decomposition is suitable for hardware implementation with LUT3 blocks. The partitioned system is presented in Figure 6f.
Another important task that involves the functional decomposition is related to the multi-output functions that are more commonly used instead of single functions. In order to perform the optimization, the synthesis tools try to optimize the number of LUT blocks by sharing resources between functions. The essence of the problem is to find bound functions g which, by assigning the appropriate codes, are used in several functions of the entire group. The idea of sharing bound functions is explained by an example shown in Figure 7. It is assumed that multi-output function   f 1 f 2   is going to be implemented within LUT3 blocks. The cutting line of the diagrams is drawn below the third level of the nodes. In the case of a separate implementation of both functions, four LUT3 blocks are required (Figure 7a,b).
Another possibility is merging   f 1   and   f 2   diagrams into the single multiterminal diagram, allowing for a common bound block (Figure 7c). There are six cut nodes (1, …, 6), and thus   log 2 6 = 3   functions   g 1 , g 2 , g 3   are required to encode the patterns. Before the decomposition, each of the functions   f 1   and   f 2   consist of four arguments. After the decomposition, the free blocks still include four variables (  g 1 , g 2 , g 3 , x 4 ) (Figure 7c). This means that in such a case, the decomposition is useless, since no reduction in the number of inputs is achieved.
The above example clearly shows that the sharing of all bound functions is not always effective. Indeed, the crucial aspect refers to the determination of if an effective bound function common to   f 1   and   f 2   could be found. Figure 6d shows a table of cut nodes and paths leading from the root node to the cut nodes. Note that node c can be reached from the root   f 1 , traversing the path   x 1 x 2 x 3   = 000 or 100 (Figure 7a) as indicated in columns 000 and 100 in the node table. Based on the node table, a graph of compliance is created, as shown in Figure 7e. Individual nodes are associated with paths of bound variables (columns of the node table). If the nodes of the graph (or columns of the table) are assigned with the same symbol (e.g., c for 000 and 100), then they are connected by an edge (e.g., red edge for c). Nodes connected by edges divide the vertices into two groups (two cliques). This division imposes an appropriate encoding which is equal to the bound function   g ' 1   common for   f 1   and   f 2 . This finally leads to resource sharing, as shown in Figure 7f. Due to the partial sharing of bound functions, only three LUT blocks are used to implement the bound block (  g ' 1 , g 2 , g 3 , Figure 7f), opposite to the previous version, where four LUT blocks (  g 1 , g 2 , g 3 , g 4 , Figure 7a,b) are used.
Concluding the presented techniques, let us underline that the decomposition of the system is crucial in terms of implementation of the concurrent system within an FPGA device. There are several possibilities and strategies related to the selection of appropriate and well-decomposable sets of functions, as well as the direction of the decomposition and the usage of the appropriate complex decomposition models. Usually, a strategy is a combination of various techniques that are used in the appropriate selection of various parameters with respect to the implementation details. The techniques that are applied in this work follow the authors’ coherent synthesis strategy that is implemented within our tool called PdekBDD 1.0 (an extension of the DekBDD [66]).

2.4. Realization of the Concurrent Control System within FPGA

Finally, the designed Petri net-based concurrent control system is implemented within an FPGA device. This process can be divided into two main steps. Firstly, the HDL code is synthesized logically independent of the internal device structure (logic synthesis), while the second step refers to the physical implementation of the system within the FPGA (translate, map, and place and route process). The whole process is strictly executed according to the vendor rules of the destination FPGA device. In this paper, guidelines for Xilinx devices are applied; however, the technique is similar for different FPGA vendors.
Initially, the optimized Verilog code of the designed concurrent control system is logically synthesized. Such a code is achieved as the result of the previous step of the presented design flow (c.f. Section 2.3), where logic equations are decomposed and optimized. Logical synthesis transforms the Verilog code into the low-level (also called “gate-level”) representation. Such a description is further implemented, that is, mapped, placed, and routed to the particular FPGA internal structure. As the result of the implementation, a programming bitstream file is produced. This file is used for the final configuration (physical implementation) of the FPGA. Since the presented technique is aimed at the reduction in the logic blocks of the programmable device, the most important values are obtained during the logical implementation step. Those results are essential and fundamental in the comparison with the traditional design flow (without applying the proposed functional decomposition method). The utilization of the device resources clearly indicates the usefulness of the introduced technique. Let us explain it in detail by a real-life example of the photovoltaic control system shown in the subsequent section.

3. Case Study: Design and Implementation of the Photovoltaic Control System

The modeling and design technique proposed in this paper is explained by a real-life case study example. Figure 8 shows the concept of a smart photovoltaic control system. The main aim of the presented concurrent system is to control the solar panels depending on their temperature and current power production in order to prevent the overloading of the electricity grid. As photovoltaic systems become more popular nowadays, the risk of grid overloading increases [90,91]. Therefore, the presented concurrent control system permits the control of the production and allows for the reduction in the production by the dynamical switching on/off of particular solar cells.
In the realm of renewable energy, smart photovoltaic (PV) control systems represent a significant leap forward in managing and optimizing energy production. However, the current landscape of these systems is characterized by a reliance on traditional control methodologies that are often rigid and unable to capitalize on the dynamic nature of solar energy fully. These conventional systems are limited by their rule-based algorithms which cannot adequately handle the variability and unpredictability inherent in solar irradiance and weather conditions. As a result, a substantial gap exists between the potential and actual performance of PV systems, leading to inefficiencies and energy losses [92]. The proposed hybrid approach seeks to bridge this gap by introducing a sophisticated layer of machine learning algorithms that can learn from data, predict future conditions, and make intelligent decisions in real time [92]. This approach is inspired by recent advancements in subsurface engineering environments, where intelligent decision-making strategies have been successfully applied to predict fire intensity and rockburst events. By adopting similar machine learning techniques, such as t-SNE for dimensionality reduction, K-Means Clustering for pattern recognition, and XGBoost for predictive modeling, the hybrid system aims to overcome the limitations of existing PV control methodologies [93]. This integration of machine learning not only enhances the adaptability and efficiency of the control system but also paves the way for a more resilient and responsive energy grid. Thus, the novelty of the hybrid approach lies in its potential to transform the smart PV control landscape, offering a solution that is both innovative and imperative for the advancement of sustainable energy systems [94].
Going into the details of the proposed photovoltaic system, each panel of the presented photovoltaic system is composed of eight solar cells (modules), denoted by   m 1 ,   m 2 ,   ,   m 8 . Furthermore, each module contains built-in sensors that allow for the measurement of its temperature and current power production. The measured data are sent to the operational center. Depending on the needs, the operational center dynamically configures the system by adjusting the number of enabled solar cells. The system works as follows. Firstly, the system examines whether the particular solar cell is enabled or disabled. The measurement is performed only for the enabled modules. If such a condition is fulfilled, the current temperature and power production are read from the sensors. The obtained data are analyzed by the modeled concurrent control system according to the over-high temperature and overload of the power. Finally, the result is sent to the operational center, which makes a decision about switching on or off the particular panels to prevent the overloading of the electricity grid. To avoid improper measurements (e.g., in the case where the particular module is disabled), particular sensors are active only if the referred module is enabled. Let us formally specify the discussed smart photovoltaic system by an interpreted Petri net.

3.1. Modeling of the Photovoltaic Control System

The Petri net-based model of the proposed photovoltaic control system is shown in Figure 9. The discussed Petri net consists of 109 places and 108 transitions.
Looking from the general point of view, the presented model consists of eight block modules that strictly refer to the particular photovoltaic modules (solar cells). Since the whole specification is large, a single module (a part of the system) is shown in Figure 10.
The specification has been initially prepared in the IOPT-Tools v 1.2 software and further exported to the Hippo system [19]. Note that the presented figures are directly taken from Hippo, and they show the general overview of the system (without input/output signals associated with places/transitions). Table 1 shows the associations between the input signals and transitions. Note that there are values for the first module presented, while the associations for the remaining modules are similar. For example, signal   e 1   (1st module is enabled) is assigned to the transition   t 5 , etc.
Similarly, output signals are associated with places of the interpreted Petri net. There are 12 outputs in total grouped into three 4-bit vectors, as shown in Table 2. The outputs contain the values determined by the system (status of the system): the number of enabled (working) modules, the number of panels with correct power (e.g., within the assumed ranges), and the number of panels with the correct temperature.
Once the system was modeled within IOPT-Tools, it was verified and validated. The validation was conducted within IOPT-Tools by simulating the behavior of the system. However, IOPT-Tools was not able to perform the verification of the system due to the state explosion problem. Moreover, the application of another popular tool PIPE [84] was also not successful. Therefore, the modeled system was converted to the Hippo system and analyzed with the use of the authors’ methods and techniques (see [20,23,88] for more details). The verification was successful, and the system was ready for further steps of the proposed prototyping flow.

3.2. Transformation of the Petri Net-Based Description into Verilog HDL Code

The transformation of the modeled photovoltaic system to the Verilog code was performed strictly according to the rules presented in Section 2.2. Listing 4 shows the declaration of the main module and input/output signals of the system.
Listing 4. Declaration of the module of the photovoltaic system.
Applsci 14 05212 i004
There are 12 registered outputs that strictly refer to the output signals described in the previous section. Moreover, there are 26 input signals in total, and 24 of them correspond to the input signals associated with photovoltaic modules, while the 2 remaining refer to the clock and reset signals. Listing 5 shows the sample equations for transitions and places. According to the rules described in Section 2.2, transitions are declared as wires and utilize continuous assignments, while places are declared as registers and involve procedural assignments. Since the system is synchronous, the states (markings) are changed with the rising edge of the clock signal. Furthermore, the asynchronous reset signal zeroes the system by returning to the initial marking. It can be noticed that there are equations that include six input variables and more. For example, the equation for transition t2 (line 04) involves eight input signals (logical conjunction of eight variables). According to the discussion shown in Section 3.3, such equations can be a good basis for the functional decomposition and reduction in the FPGA resources. However, in the presented photovoltaic system, other equations are going to be optimized.
Listing 5. Equations for transitions and places.
Applsci 14 05212 i005
Listing 6 presents sample equations for the outputs. The particular values (status_e, status_p, and status_t) are computed based on the current status of sensors. The computation is performed by combinational logic. Each of the resulting equations is formulated by the disjunctive normal form (DNF) as a sum of products (minterms). Let us underline that equations for the three lower bits of each output (that is, status_e[0], status_e[1], status_e[2], status_p[0], status_p[1], status_p[2], and status_t[0], status_t[1], status_t[2]) include multiple products (even over one hundred). Therefore, the code shown in Listing 6 presents the sample values (products). The complete equations for the output status_e can be found in Appendix A (the remaining two outputs status_p and status_t are computed in a similar way). Obviously, such a huge number of minterms can be an excellent object for further optimization. The next subsection presents the functional decomposition of the discussed photovoltaic system.
Listing 6. Equations for outputs.
Applsci 14 05212 i006

3.3. Optimization of the Photovoltaic Control System

According to the proposed prototyping flow, both the sequential and combinational parts of the concurrent control system are the subject of optimization. Firstly, the redundant expressions and possible number of flip-flops are minimized and reduced. The minimization process is presented for the registers representing places   p 99 ,   p 100 , and   p 101 . The original equations that describe the concurrent control system are as follows:
t 98 = p 99 p 99 p 99   t 98 ¯   + t 95
However, inserting   t 98   into the equation of   p 99 ,    we obtain the following:
p 99 p 99   p 99 ¯   + t 95 p 99   t 95
Furthermore, the original equations are the following:
t 100 = p 100   p w 8 t 101 = p 100   p w 8 ¯ p 100 p 100   t 100 ¯   t 101 ¯   + t 95
Inserting   t 100   and   t 101   into   p 100 , we obtain the following:
p 100 p 100 p 100 ¯ + p w 8 ¯ p 100 ¯ + p w 8 ¯ + t 95 p 100 p 100     p 100 ¯ + p 100 ¯     p w 8 + p w 8 ¯     p 100 ¯ + 0 +   t 95 p 100 t 95
Finally, the original equations of   p 101   are the following:
t 104 = p 101   t p 8 t 105 = p 101   t p 8 ¯ p 101 p 101   t 104 ¯     t 105 ¯   + t 95
Inserting   t 104   and   t 105   into   p 101 , we obtain the following:
p 101 p 101     p 101 ¯ + t p 8 ¯     p 101 ¯ + t p 8   + t 95 p 101 p 101     p 101 ¯ + p 101 ¯   t p 8 + t p 8 ¯   p 101 ¯ + 0 + t 95 p 101 t 95
As it is shown, places   p 99 ,   p 100 , and   p 101   can be merged and replaced by the single flip-flop. The final result is achieved by algebraic transformations. However, the algorithm applies BDDs, where the function representation is canonical, and the equivalence of the presented flip-flops can be immediately checked.
Moving on to the optimization of the combinational part, we will follow the status_e signals, while the complete description of the whole system is presented in Appendix A (Listings A1–A4). Firstly, the logical equation is decomposed according to the procedure shown in Section 2.3 and combined with finding common subfunctions. The resulting description is shown in Listing 7. There are bound functions g0, …, g5 which are arguments of the logic function status_e[0], …, status_e[3]. Let us underline that the number of arguments of each decomposed function does not exceed 5. This means that they can be implemented in the single LUT 5 (a five-input LUT) blocks.
Figure 11 shows a schematic of the decomposed functions. Note that functions g2, ..., g5 are used only once, which means that their outputs are connected only to one input of another LUT. However, g0 and g1 functions are arguments of several other functions. This means that they are shared among the other functions. Such sharing is essential in the decomposition process and may lead to the significant reduction in the utilized FPGA resources.
Listing 7. Equation for output after decomposition.
Applsci 14 05212 i007

3.4. Realization of the Photovoltaic System within FPGA

Finally, the designed photovoltaic Petri net-based system is implemented within the FPGA. As a destination, the XC7A100T device from the Artix-7 family is selected. The implementation process is performed within the dedicated Xilinx tool, Vivado ver. 2023.1.
To perform the final implementation, the system ought to be firstly logically synthesized. This process is executed within the Vivado 2023.1 tool, exactly according to the Xilinx requirements [95]. Logical synthesis returns no errors, which confirms the proper description of the system in the Verilog hardware description language. At the next step, the logical implementation is executed. As shown in Figure 12, this process does not return errors in the designed photovoltaic system, as well. This means that the designed system is properly prepared in accordance with the device structure and can be physically implemented within the selected FPGA.
However, in order to validate the functionality before the physical implementation, the designed system is simulated within the Vivado environment. Figure 13 shows the results of validation. Based on the stimulated input signals, adequate output signals are obtained. Let us underline that the achieved results confirm the assumptions and thus the proper functionality of the photovoltaic system. Let us now evaluate the proposed optimization technique by the analysis of the utilization of the FPGA resources.
Finally, the system is physically implemented and validated within the real FPGA device. To perform this, the Nexys4 DDR prototyping board was used. The presented concurrent control system was implemented with XC7A100T FPGA. This board contains switches and a 7-segment display, that are used to stimulate remaining input and output values, respectively. Due to the limited number of switches, there is a possibility of controlling the first five panels (it is just assumed that the remaining three are working properly). Additionally, the seven-segment display is used to indicate the number of panels successfully powered on, with correct power and optimal temperature. The count of panels with proper power or temperature is visible on the display after pressing the corresponding momentary button.
Figure 14 shows the experimental setup of the discussed system. Note that the presented figure corresponds to the results of simulation shown in Figure 13. At the illustrated state (marking) of the system, six panels are enabled (which is signalized by the seven-segment display). Indeed, two panels are turned off since switches that correspond to signals   e 1   and   e 3   are in a low state.

4. Discussion on the Proposed Technique and Results Obtained during the Experiments

This section discusses and evaluates the prototyping method proposed in the paper. To carefully evaluate the efficiency of the presented technique, the proposed ideas are examined and compared to the existing prototyping and optimization methods. Firstly, the results achieved during the implementation of the photovoltaic system are presented and compared to the traditional design technique. Subsequently, the proposed decomposition method is evaluated and compared to the other optimization ideas.

4.1. Discussion on the Results Achieved during Implementation of the Photovoltaic System

In order to evaluate the optimization technique presented in the paper, the results achieved in the previous section are compared with the values obtained in the traditional design flow. As a reference method (denoted as “traditional technique”), the prototyping idea shown in previous authors’ works is selected [13,41,43]. In particular, the presented photovoltaic system is designed without the application of the proposed functional decomposition. The whole procedure is the same, except for the optimization shown in Section 3.3.
To examine the proper functionality, the validation of both systems (that is, the one achieved by the proposed technique and the traditional one) is executed. To perform this, results of the simulation of both systems are compared. It should be noted that validation returns exactly the same results, which means that the applied optimizations do not interfere with the functionality of the system.
Finally, the evaluation of the presented optimization technique is performed. Table 3 shows the implementation results obtained for both techniques. The first column contains the analyzed resources: look-up tables (LUTs), flip-flops (FFs), input/output blocks (IOs), and buffers (BUFGs). The second and third columns present the utilized resources obtained with the proposed and traditional design technique, respectively.
From the values shown in Table 3, it can be noticed that the proposed technique permits dropping the number of utilized look-up tables. The traditional design flow consumes 126 LUTs, while the presented optimizations allow for the reduction in utilized logic blocks by 28%.
Furthermore, let us compare the impact of the sequential optimization—a novel technique proposed in this paper. The obtained synthesis results are as follows:
  • initial system (without any optimization):         126 LUTs, 114 FFs,
  • system with combinational optimization only:      95 LUTs, 122 FFs,
  • system with combinational and sequential optimizations: 91 LUTs, 114 FFs.
It can be noticed that the innovative optimization of the sequential areas of the concurrent control system benefited a significant reduction in the resources. However, the application of the functional decomposition is not enough in this particular case. Although the number of LUTs decreases, the number of registers becomes much larger. Nevertheless, optimization of the redundant flip-flops proposed in this work drops down the number of utilized registers and additionally decreases the number of LUTs.
To summarize the above discussion, let us underline that in the context of FPGA resource utilization, the obtained values should be considered as a very good result. The “saved” resources can be, for example, effectively utilized by other blocks of the prototyped concurrent control system. Moreover, such a reduction is essential in the case of farms of photovoltaic panels. Assume a system that consists of hundreds or even thousands of such solar cells. The initial estimation shows that the traditional design technique allows for the implementation of up to 503 solar panels. Conversely, the application of the proposed optimization method increases the possible utilized panels up to 696. Of course, those are just initial estimations (although the implementation of photovoltaic farms is planned in our further papers); nevertheless, it shows the practical benefit of the proposed technique.

4.2. Discussion on the Efficiency of the Applied Decomposition Technique

Let us now discuss the applied optimization technique in detail. The proposed method is based on the decomposition of logic functions represented by the BDD form and extensively searching for common subexpressions. In order to evaluate the efficiency of the presented optimization idea, let us compare it with the others that are already known in the literature: Decomp [51], ABC [53], DAOmap [54], DDBDD [57], BDS-PGA 2.0 [58], and MultiDec [66].
The Decomp system uses a classic decomposition theory by Ashenhurst–Curtis, effectively coping with multi-output functions and incompletely specified functions. The ABC technique is based on the And-Inverter Graph representation of circuit and structural transformations. The DAOmap method also cuts AIGs but under mapping depth constraints. The three remaining tools apply BDDs to represent the logic functions. The DDBDD technique uses a technique called linear expansion for BDD decomposition, which, in turn, enables a dynamic programming algorithm to efficiently search through the optimization space. The BDS-PGA method heuristically manipulates BDDs with resynthesis elements. The MultiDec tool is also based on cutting BDDs but uses multiple cutting to achieve parallel decomposition and the results are evaluated with triangle tables. Finally, the MultiDec tool and the PdekBDD are able to use blocks which could be configured to five inputs and one output or four inputs and two outputs.
Table 4 shows the results of experiments where the proposed decomposition method is compared to the existing ones. The set of benchmarks is taken from [96]. The first three columns show the name and the number of inputs and outputs of the benchmark circuit. The remaining columns show the number of five-input blocks. There are gaps in the table since not all results are available. At the bottom of Table 1 is the sum of the number of blocks. In the last row, the ratio of the sum of blocks by number for a given tool to the corresponding sum of blocks for PdekBDD is presented. For all tools except BDS-PGA, the ratio is greater than 1, which means that PdekBDD gives better results. In one extreme case (ex1010 benchmark), PdekBDD gives eight times better results than DDBDD and seven times better results than DAOmap, but these tools are delay constrained. Only for BDS-PGA is the total result of PdekBDD worse by about 9%. This is mainly due to the alu4 benchmark where BDS-PGA achieves 190 blocks and PdekBDD 324. The authors’ tool gives a very low number of blocks for symmetric functions (9sym) or multi-output functions with symmetric functions (rd73 and rd84). PdekBDD achieves good results when it comes to minimizing chip area occupancy. The main disadvantage of PdekBDD is that it does not support the do not care state and the delay in the chip can only indirectly be reduced by reducing the number of blocks—there is no way to impose restrictions on the propagation time in the target system.

5. Conclusions

A novel design approach of a Petri net-based concurrent control system is proposed in this paper. The method is oriented toward effective realization of the system in an FPGA device. To achieve this, the system is optimized by authors’ techniques. In particular, the sequential and combinational parts of the system are reduced and optimized. The proposed design flow includes all the necessary steps that are required to implement the concurrent control system within the programmable device. Firstly, the system is modeled by an interpreted Petri net, which is transformed into the Verilog hardware description language. The optimization of the design is performed by reducing the redundant sequential logic and further functional decomposition. Finally, the system is implemented within an FPGA.
The efficiency of the proposed technique was verified experimentally. To perform this, a real-life example of a photovoltaic concurrent control system was designed and optimized. The obtained results indicate a high reduction in the number of utilized logic blocks compared to the traditional solutions. A photovoltaic system designed and optimized with the presented method requires 91 LUTs and 114 flip-flops, while the classical approach utilized 126 LUTs and 114 FFs. This means that the number of LUTs was decreased by 28%, which is a very good result. It should be underlined that thanks to the introduced sequential reduction in the system, the number of logic blocks significantly decreased, while the number of flip-flops remained unchanged.
Although the experimental results confirm the high efficiency of the proposed technique, there are also limitations of the presented method. First of all, the introduced sequential optimization idea can be applied only to the systems operating in a single-clock domain. This means that all registers of the design ought to be oscillated by the same clock. Nevertheless, let us point out that such a situation is usual in the case of FPGA-oriented systems. Furthermore, the presented method involves Petri net theory. Although the modeling of the system with Petri net is relatively easy and comfortable, it requires specific knowledge from the designer, especially in terms of concurrent systems oriented toward implementation within FPGA devices. Finally, the proposed method assumes the transformation of the system to the Verilog code and further optimization of the sequential and combinational parts. At this moment, the above mechanisms are semi-automated. There exists the transformation of the Petri net-based system to the Verilog code (within the authors’ Hippo system), but it ought to be supplemented by adequate input and output signals. Similarly, there is a tool for functional decomposition, PdekBDD (developed by the authors). Nevertheless, the authors of this paper plan to extend their tools, especially with such optimistic experimental results.
Plans for the future include further development of the proposed idea. In particular, it is planned to apply the verification of the system at the early prototyping stage. Such an examination may help avoid mistakes caused by the designer that are usually detected during the synthesis process. Furthermore, the presented photovoltaic system is going to be extended to the farms of panels. As shown by the preliminary research results, the traditional realization permits the implementation of 503 controllers of solar panels, while the presented technique allows for the realization of 696 cells within the single FPGA. Therefore, it is planned to perform more complex research in order to confirm such a high efficiency of the proposed technique.

Author Contributions

Conceptualization, R.W. and A.O.; methodology, R.W. and A.O.; validation, R.W., A.O. and M.W.; formal analysis, R.W., A.O. and M.W.; investigation, R.W., A.O. and M.W.; resources, R.W., A.O. and M.W.; writing—original draft preparation, R.W., A.O. and M.W.; writing—review and editing, R.W., A.O. and M.W.; visualization, A.O. and M.W.; supervision, R.W.; funding acquisition, A.O. All authors have read and agreed to the published version of the manuscript.

Funding

This work was partially supported by the National Science Centre, Poland, under Grant number 2019/35/B/ST6/01683, and the Silesian University of Technology under the BK 2024 statutory research project.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Acknowledgments

(1) This work was conducted as a result of an internship of the author (R. Wisniewski) at the Silesian University of Technology, Poland. (2) This work was conducted as a result of an internship of the author (A. Opara) at the University of Zielona Góra, Poland.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Listing A1. The complete equation for the output status_e[0].
Applsci 14 05212 i008
Applsci 14 05212 i009
Listing A2. The complete equation for the output status_e[1].
Applsci 14 05212 i010
Listing A3. The complete equation for the output status_e[2].
Applsci 14 05212 i011
Applsci 14 05212 i012
Listing A4. The complete equation for the output status_e[3].
Applsci 14 05212 i013

References

  1. Girault, C.; Valk, R. Petri Nets for Systems Engineering: A Guide to Modeling, Verification, and Applications; Springer: Berlin/Heidelberg, Germany, 2003; ISBN 978-3-540-41217-5. [Google Scholar]
  2. Reisig, W.; Rozenberg, G. (Eds.) Lectures on Petri Nets I: Basic Models: Advances in Petri Nets; Lecture Notes in Computer Science, Lect. Notes Computer. Tutorial; Springer: Berlin/Heidelberg, Germany, 1998; ISBN 978-3-540-65306-6. [Google Scholar]
  3. Ferrarini, L. Computer Aided Design of Logic Controllers with Petri Nets. In Petri Nets in Flexible and Agile Automation; Zhou, M., Ed.; The Springer International Series in Engineering and Computer Science; Springer: Boston, MA, USA, 1995; pp. 71–92. ISBN 978-1-4615-2231-7. [Google Scholar]
  4. Majdzik, P. A Feasible Schedule for Parallel Assembly Tasks in Flexible Manufacturing Systems. Int. J. Appl. Math. Comput. Sci. 2022, 32, 51–63. [Google Scholar] [CrossRef]
  5. Patalas-Maliszewska, J.; Wiśniewski, R.; Topczak, M.; Wojnakowski, M. Design Optimization of the Petri Net-Based Production Process Supported by Additive Manufacturing Technologies. Bull. Pol. Acad. Sci. Tech. Sci. 2022, 70, e140693. [Google Scholar] [CrossRef]
  6. Wiśniewski, R.; Patalas-Maliszewska, J.; Wojnakowski, M.; Topczak, M. Interpreted Petri Nets in Modelling and Analysis of Physical Resilient Manufacturing Systems. In Proceedings of the 2022 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Prague, Czech Republic, 9–12 October 2022; pp. 1096–1102. [Google Scholar]
  7. Rybarczyk, A.; Formanowicz, D.; Radom, M.; Formanowicz, P. Cholesterol Metabolism Pathways Disturbances in Atherosclerosis—Analyses Using Stochastic Petri Net-Based Model. Appl. Sci. 2023, 13, 6149. [Google Scholar] [CrossRef]
  8. Lee, E.A.; Seshia, S.A. Introduction to Embedded Systems: A Cyber-Physical Systems Approach, 2nd ed.; The MIT Press: Cambridge, MA, USA, 2016; ISBN 978-0-262-53381-2. [Google Scholar]
  9. Liu, L.; Pu, Y.; Liu, Z.; Liu, J. Analysis of Green Closed-Loop Supply Chain Efficiency under Generalized Stochastic Petri Nets. Sustainability 2023, 15, 13181. [Google Scholar] [CrossRef]
  10. Du, Y.; Zhou, Y.; Hu, H. Dynamic Assignment of Roles and Users for Business Processes Under Security Requirements. IEEE Trans. Ind. Inform. 2023, 19, 10344–10355. [Google Scholar] [CrossRef]
  11. Patalas-Maliszewska, J.; Wiśniewski, R.; Topczak, M.; Wojnakowski, M. Modelling of the Effectiveness of Integrating Additive Manufacturing Technologies into Petri Net-Based Manufacturing Systems. In Proceedings of the 2022 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), Padua, Italy, 18–23 July 2022; pp. 1–9. [Google Scholar]
  12. Karatkevich, A. Dynamic Analysis of Petri Net-Based Discrete Systems; Lecture Notes in Control and Information Sciences; Springer: Berlin/Heidelberg, Germany, 2007; ISBN 978-3-540-71464-4. [Google Scholar]
  13. Wiśniewski, R. Prototyping of Concurrent Control Systems Implemented in FPGA Devices; Advances in Industrial Control; Springer International Publishing: Berlin/Heidelberg, Germany, 2017; ISBN 978-3-319-45810-6. [Google Scholar]
  14. Li, Z.; Zhou, M. Two-Stage Method for Synthesizing Liveness-Enforcing Supervisors for Flexible Manufacturing Systems Using Petri Nets. IEEE Trans. Ind. Inform. 2006, 2, 313–325. [Google Scholar] [CrossRef]
  15. Wiśniewski, R.; Bazydło, G.; Szcześniak, P. Low-Cost FPGA Hardware Implementation of Matrix Converter Switch Control. IEEE Trans. Circuits Syst. II Express Briefs 2019, 66, 1177–1181. [Google Scholar] [CrossRef]
  16. Jasiul, B.; Szpyrka, M.; Śliwa, J. Formal Specification of Malware Models in the Form of Colored Petri Nets. In Proceedings of the Computer Science and Its Applications, Wuhan, China, 20–22 November 2015; Park, J.J., Jong, H., Stojmenovic, I., Jeong, H.Y., Yi, G., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 475–482. [Google Scholar]
  17. Montano, L.; García, F.J.; Villarroel, J.L. Using the Time Petri Net Formalism for Specification, Validation, and Code Generation in Robot-Control Applications. Int. J. Robot. Res. 2000, 19, 59–76. [Google Scholar] [CrossRef]
  18. Grobelna, I.; Karatkevich, A. Challenges in Application of Petri Nets in Manufacturing Systems. Electronics 2021, 10, 2305. [Google Scholar] [CrossRef]
  19. Wisniewski, R.; Bazydło, G.; Gomes, L.; Costa, A.; Wojnakowski, M. Analysis and Design Automation of Cyber-Physical System with Hippo and IOPT-Tools. In Proceedings of the IECON 2019—45th Annual Conference of the IEEE Industrial Electronics Society, Lisbon, Portugal, 14–17 October 2019; Volume 1, pp. 5843–5848. [Google Scholar]
  20. Wojnakowski, M.; Popławski, M.; Wiśniewski, R.; Bazydło, G. Hippo-CPS: Verification of Boundedness, Safeness and Liveness of Petri Net-Based Cyber-Physical Systems. In Proceedings of the Technological Innovation for Digitalization and Virtualization, Caparica, Portugal, 29 June–1 July 2022; Camarinha-Matos, L.M., Ed.; Springer International Publishing: Cham, Switzerland, 2022; pp. 74–82. [Google Scholar]
  21. Wiśniewski, R.; Karatkevich, A.; Adamski, M.; Costa, A.; Gomes, L. Prototyping of Concurrent Control Systems With Application of Petri Nets and Comparability Graphs. IEEE Trans. Control Syst. Technol. 2018, 26, 575–586. [Google Scholar] [CrossRef]
  22. Diaz, M. Applying Petri Net Based Models in the Design of Systems. In Concurrency and Nets: Advances in Petri Nets; Voss, K., Genrich, H.J., Rozenberg, G., Eds.; Springer: Berlin/Heidelberg, Germany, 1987; pp. 23–67. ISBN 978-3-642-72822-8. [Google Scholar]
  23. Wiśniewski, R.; Patalas-Maliszewska, J.; Wojnakowski, M.; Topczak, M.; Zhou, M. Fast Verification of Petri Net-Based Model of Industrial Decision-Making Systems: A Case Study. In Proceedings of the 2023 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Oahu, HI, USA, 1–4 October 2023. [Google Scholar]
  24. van der Aalst, W.M.P. Workflow Verification: Finding Control-Flow Errors Using Petri-Net-Based Techniques. In Business Process Management: Models, Techniques, and Empirical Studies; van der Aalst, W., Desel, J., Oberweis, A., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2000; pp. 161–183. ISBN 978-3-540-45594-3. [Google Scholar]
  25. Best, E.; Devillers, R.; Koutny, M. Petri Net Algebra; Monographs in Theoretical Computer Science. An EATCS Series; Springer: Berlin/Heidelberg, Germany, 2001; ISBN 978-3-540-67398-9. [Google Scholar]
  26. Harie, Y.; Wasaki, K. Analysis of Structural Liveness and Boundedness in Weighted Free-Choice Net Based on Circuit Flow Values. In Proceedings of the Intelligent Computing, London, UK, 16–17 July 2020; Arai, K., Kapoor, S., Bhatia, R., Eds.; Springer International Publishing: Cham, Switzerland, 2020; pp. 570–580. [Google Scholar]
  27. David, R.; Alla, H. Bases of Petri Nets. In Discrete, Continuous, and Hybrid Petri Nets; David, R., Alla, H., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 1–20. ISBN 978-3-642-10669-9. [Google Scholar]
  28. Wojnakowski, M.; Wiśniewski, R.; Popławski, M. Bounded and Place Invariant-Covered Petri Nets for Cyber-Physical Systems Specification. In Proceedings of the AIP Conference Proceedings, Virtual, 26–29 October 2022; AIP: Heraklion, Crete, Greece, 2024. [Google Scholar]
  29. Wojnakowski, M.; Wiśniewski, R.; Bazydło, G.; Popławski, M. Analysis of Safeness in a Petri Net-Based Specification of the Control Part of Cyber-Physical Systems. Appl. Math. Comput. Sci. 2021, 31, 647–657. [Google Scholar] [CrossRef]
  30. Hardware Design and Petri Nets; Yakovlev, A.; Gomes, L.; Lavagno, L. (Eds.) Springer: New York, NY, USA, 2000; ISBN 978-0-7923-7791-7. [Google Scholar]
  31. Wojnakowski, M.; Wiśniewski, R. Verification of the Boundedness Property in a Petri Net-Based Specification of the Control Part of Cyber-Physical Systems. In Proceedings of the Technological Innovation for Applied AI Systems, Costa de Caparica, Portugal, 7–9 July 2021; Camarinha-Matos, L.M., Ferreira, P., Brito, G., Eds.; Springer International Publishing: Cham, Switzerland, 2021; pp. 83–91. [Google Scholar]
  32. Grobelna, I.; Wiśniewski, R.; Wojnakowski, M. Specification of Cyber-Physical Systems with the Application of Interpreted Nets. In Proceedings of the IECON 2019—45th Annual Conference of the IEEE Industrial Electronics Society, Lisbon, Portugal, 14–17 October 2019; Volume 1, pp. 5887–5891. [Google Scholar]
  33. Wiśniewski, R.; Patalas-Maliszewska, J.; Wojnakowski, M.; Topczak, M. Modeling and Analysis of a Petri Net-Based System Supporting Implementation of Additive Manufacturing Technologies. IEEE Trans. Autom. Sci. Eng. 2023, 1–11. [Google Scholar] [CrossRef]
  34. Xilinx 7 Series FPGAs Configurable Logic Block User Guide (UG474). Available online: https://docs.xilinx.com/v/u/en-US/ug474_7Series_CLB (accessed on 22 October 2023).
  35. Wiśniewski, R.; Bazydło, G.; Szcześniak, P.; Wojnakowski, M. Petri Net-Based Specification of Cyber-Physical Systems Oriented to Control Direct Matrix Converters With Space Vector Modulation. IEEE Access 2019, 7, 23407–23420. [Google Scholar] [CrossRef]
  36. Stój, J.; Ziębiński, A.; Cupek, R. FPGA Based Industrial Ethernet Network Analyser for Real-Time Systems Providing Openness for Industry 4.0. Enterp. Inf. Syst. 2022, 16, 1711–1731. [Google Scholar] [CrossRef]
  37. Bazydło, G. Designing Reconfigurable Cyber-Physical Systems Using Unified Modeling Language. Energies 2023, 16, 1273. [Google Scholar] [CrossRef]
  38. Wiśniewski, R. Dynamic Partial Reconfiguration of Concurrent Control Systems Specified by Petri Nets and Implemented in Xilinx FPGA Devices. IEEE Access 2018, 6, 32376–32391. [Google Scholar] [CrossRef]
  39. Wiśniewski, R.; Bazydło, G.; Gomes, L.; Costa, A. Dynamic Partial Reconfiguration of Concurrent Control Systems Implemented in FPGA Devices. IEEE Trans. Ind. Inform. 2017, 13, 1734–1741. [Google Scholar] [CrossRef]
  40. An FPGA Flies on Mars. EEJournal 2022. Available online: https://www.eejournal.com/article/an-fpga-flies-on-mars/ (accessed on 11 June 2024).
  41. Wiśniewski, R.; Wojnakowski, M.; Li, Z. Design and Verification of Petri-Net-Based Cyber-Physical Systems Oriented toward Implementation in Field-Programmable Gate Arrays—A Case Study Example. Energies 2023, 16, 67. [Google Scholar] [CrossRef]
  42. Costa, A.; Gomes, L.; Barros, J.P.; Oliveira, J.; Reis, T. Petri Nets Tools Framework Supporting FPGA-Based Controller Implementations. In Proceedings of the 2008 34th Annual Conference of IEEE Industrial Electronics, Orlando, FL, USA, 10–13 November 2008; pp. 2477–2482. [Google Scholar]
  43. Wiśniewski, R. Design of Petri Net-Based Cyber-Physical Systems Oriented on the Implementation in Field Programmable Gate Arrays. Energies 2021, 14, 7054. [Google Scholar] [CrossRef]
  44. Gomes, L.; Costa, A.; Barros, J.P.; Lima, P. From Petri Net Models to VHDL Implementation of Digital Controllers. In Proceedings of the IECON 2007—33rd Annual Conference of the IEEE Industrial Electronics Society, Taipei, Taiwan, 5–8 November 2007; pp. 94–99. [Google Scholar]
  45. Opara, A.; Kubica, M. The Choice of Decomposition Path Taking Non-Disjoint Decomposition into Account. In Proceedings of the AIP Conference Proceedings, Thessaloniki, Greece, 14–18 March 2018; AIP Publishing LLC: College Park, MD, USA, 2018; Volume 2040, p. 080010. [Google Scholar]
  46. Opara, A.; Kubica, M. Optimization of Synthesis Process Directed at FPGA Circuits with the Usage of Non-Disjoint Decomposition. In Proceedings of the AIP Conference Proceedings, Thessaloniki, Greece, 21–25 April 2017; AIP Publishing LLC: College Park, MD, USA, 2017; Volume 1906, p. 120004. [Google Scholar]
  47. Opara, A.; Kubica, M. Decomposition Synthesis Strategy Directed to FPGA with Special MTBDD Representation. In Proceedings of the AIP Conference Proceedings, Athens, Greece, 17–20 March 2016; Kalogiratou, Z., Monovasilis, T., Simos, T.E., Eds.; American Institute of Physics Inc.: College Park, MD, USA, 2016; Volume 1790. [Google Scholar]
  48. Kubica, M.; Opara, A.; Kania, D. Logic Synthesis for FPGAs Based on Cutting of BDD. Microprocess. Microsyst. 2017, 52, 173–187. [Google Scholar] [CrossRef]
  49. Rawski, M.; Jozwiak, L.; Nowicka, M.; Luba, T. Non-Disjoint Decomposition of Boolean Functions and Its Application in FPGA-Oriented Technology Mapping. In Proceedings of the 23rd EUROMICRO Conference: New Frontiers of Information Technology (Cat. No. 97TB100167), Budapest, Hungary, 1–4 September 1997; IEEE: Piscataway, NJ, USA, 1997; pp. 24–30. [Google Scholar]
  50. Lai, Y.-T.; Pan, K.-R.; Pedram, M. OBDD-Based Function Decomposition: Algorithms and Implementation. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 1996, 15, 977–990. [Google Scholar]
  51. Kania, D. Decomposition Elements Dedicated for LUT-Based FPGAs. Arch. Inform. Teoretycznej Stosow. 2004, 16, 45–62. [Google Scholar]
  52. Curtis, H.A. The Design of Switching Circuits; D.van Nostrand Company: New York, NY, USA, 1962. [Google Scholar]
  53. Brayton, R.; Mishchenko, A. ABC: An Academic Industrial-Strength Verification Tool. In Proceedings of the Computer Aided Verification, Edinburgh, UK, 15–19 July 2010; Touili, T., Cook, B., Jackson, P., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 24–40. [Google Scholar]
  54. Chen, D.; Cong, J. DAOmap: A Depth-Optimal Area Optimization Mapping Algorithm for FPGA Designs. In Proceedings of the IEEE/ACM International Conference on Computer Aided Design, ICCAD-2004, Washington, DC, USA, 11–13 October 2004; IEEE: Piscataway, NJ, USA, 2004; pp. 752–759. [Google Scholar]
  55. Fiser, P.; Schmidt, J. On Using Permutation of Variables to Improve the Iterative Power of Resynthesis. In Proceedings of the 10th International Workshop on Boolean Problems (IWSBP), Freiberg, Germany, 19–21 September 2012; pp. 107–114. [Google Scholar]
  56. Schmidt, J.; Fiser, P. The Case for a Balanced Decomposition Process. In Proceedings of the 2009 12th Euromicro Conference on Digital System Design, Architectures, Methods and Tools, Patras, Greece, 27–29 August 2009; IEEE: Piscataway, NJ, USA, 2009; pp. 601–604. [Google Scholar]
  57. Cheng, L.; Chen, D.; Wong, M.D. DDBDD: Delay-Driven BDD Synthesis for FPGAs. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2008, 27, 1203–1213. [Google Scholar] [CrossRef]
  58. Vemuri, N.; Kalla, P.; Tessier, R. BDD-Based Logic Synthesis for LUT-Based FPGAs. ACM Trans. Des. Autom. Electron. Syst. TODAES 2002, 7, 501–525. [Google Scholar] [CrossRef]
  59. Liang, Y.-Y.; Kuo, T.-Y.; Wang, S.-H.; Mak, W.-K. ALMmap: Technology Mapping for FPGAs with Adaptive Logic Modules. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2012, 31, 1134–1139. [Google Scholar] [CrossRef]
  60. Chen, S.-L.; Hwang, T.; Liu, C.L. A Technology Mapping Algorithm for CPLD Architectures. In Proceedings of the 2002 IEEE International Conference on Field-Programmable Technology, (FPT) Proceedings, Hong Kong, China, 16–18 December 2012; IEEE: Piscataway, NJ, USA, 2002; pp. 204–210. [Google Scholar]
  61. Kania, D.; Milik, A. Logic Synthesis Based on Decomposition for CPLDs. Microprocess. Microsyst. 2010, 34, 25–38. [Google Scholar] [CrossRef]
  62. Opara, A.; Kania, D. Logic Synthesis Strategy Based on BDD Decomposition and PAL-Oriented Optimization. In Proceedings of the AIP Conference Proceedings, Athens, Greece, 20–23 March 2015; Kalogiratou, Z., Monovasilis, T., Simos, T.E., Eds.; American Institute of Physics Inc.: College Park, MD, USA, 2015; Volume 1702. [Google Scholar]
  63. Kubica, M.; Kania, D. Graph of Outputs in the Process of Synthesis Directed at CPLDs. Mathematics 2019, 7, 1171. [Google Scholar] [CrossRef]
  64. Yang, C.; Ciesielski, M. BDS: A BDD-Based Logic Optimization System. Comput.-Aided Des. Integr. Circuits Syst. IEEE Trans. 2002, 21, 866–876. [Google Scholar] [CrossRef]
  65. Sánchez, F.M.; Fungairiño, Y.T.; Alcaide, T.R. A BDD Proposal for Probabilistic Switching Activity Estimation. In Proceedings of the XXIII International Conference on Design of Circuits and Integrated Systems (DCIS), Grenoble, Francia, 12–14 November 2009. [Google Scholar]
  66. Opara, A.; Kubica, M.; Kania, D. Methods of Improving Time Efficiency of Decomposition Dedicated at FPGA Structures and Using BDD in the Process of Cyber-Physical Synthesis. IEEE Access 2019, 7, 20619–20631. [Google Scholar] [CrossRef]
  67. Berkeley Logic Synthesis Group. ABC: A System for Sequential Synthesis and Verification. Available online: https://people.eecs.berkeley.edu/~alanmi/abc/ (accessed on 6 November 2023).
  68. Barzen, B.L.C.; Reais-Parsi, A.; Hung, E.; Kang, M.; Mishchenko, A.; Greene, J.W.; Wawrzynek, J. Narrowing the Synthesis Gap: Academic FPGA Synthesis Is Catching Up With the Industry. In Proceedings of the 2023 Design, Automation & Test in Europe Conference & Exhibition (DATE), Antwerp, Belgium, 17–19 April 2023; pp. 1–6. [Google Scholar]
  69. Shah, D.; Hung, E.; Wolf, C.; Bazanski, S.; Gisselquist, D.; Milanovic, M. Yosys+nextpnr: An Open Source Framework from Verilog to Bitstream for Commercial FPGAs. In Proceedings of the 2019 IEEE 27th Annual International Symposium on Field-Programmable Custom Computing Machines (FCCM), San Diego, CA, USA, 28 April–1 May 2019; IEEE: San Diego, CA, USA, 2019; pp. 1–4. [Google Scholar]
  70. Machado, L.; Cortadella, J. Support-Reducing Decomposition for FPGA Mapping. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2020, 39, 213–224. [Google Scholar] [CrossRef]
  71. Opara, A.; Kubica, M.; Kania, D. Strategy of Logic Synthesis Using MTBDD Dedicated to FPGA. Integration 2018, 62, 142–158. [Google Scholar] [CrossRef]
  72. Opara, A.; Kania, D. A Novel Non-Disjunctive Method for Decomposition of CPLDs. Electron. Telecommun. Q. 2009, 55, 95–111. [Google Scholar]
  73. Kubica, M.; Kania, D.; Opara, A. Decomposition Time Effectiveness for Various Synthesis Strategies Dedicated to FPGA Structures. In Proceedings of the AIP Conference Proceedings, Athens, Greece, 17–20 March 2016; Kalogiratou, Z., Monovasilis, T., Simos, T.E., Eds.; American Institute of Physics Inc.: College Park, MD, USA, 2016; Volume 1790. [Google Scholar]
  74. Opara, A.; Kubica, M. Technology mapping of multi-output functions leading to the reduction of dynamic power consumption in FPGAs. Int. J. Appl. Math. Comput. Sci. 2023, 33, 267–284. [Google Scholar] [CrossRef]
  75. Kubica, M.; Opara, A.; Kania, D. Decomposition Strategy Aimed at Minimizing Power Consumption. In Proceedings of the AIP Conference Proceedings, Heraklion, Greece, 4–7 September 2021; Simos, T., Tsitouras, C., Kalogiratou, Z., Eds.; American Institute of Physics Inc.: College Park, MD, USA, 2022; Volume 2611. [Google Scholar]
  76. Opara, A.; Kubica, M.; Kania, D. Decomposition Approaches for Power Reduction. IEEE Access 2023, 11, 29417–29429. [Google Scholar] [CrossRef]
  77. Opara, A.; Kubica, M.; Kania, D. Comparison of Synthesis Strategies in Terms of Switching Activity. In Proceedings of the AIP Conference Proceedings, Heraklion, Greece, 4–7 September 2021; Simos, T., Tsitouras, C., Kalogiratou, Z., Eds.; American Institute of Physics Inc.: College Park, MD, USA, 2022; Volume 2611. [Google Scholar]
  78. Kubica, M.; Kania, D. Technology Mapping of FSM Oriented to LUT-Based FPGA. Appl. Sci. 2020, 10, 3926. [Google Scholar] [CrossRef]
  79. Kubica, M.; Kajstura, K.; Kania, D. Logic Synthesis of Low Power FSM Dedicated into LUT-Based FPGA. In Proceedings of the International Conference of Computational Methods in Sciences and Engineering, Thessaloniki, Greece, 14–18 March 2018; Volume 2040. [Google Scholar]
  80. Reisig, W. Nets Consisting of Places and Transistions. In Petri Nets: An Introduction; Reisig, W., Ed.; EATCS Monographs on Theoretical Computer Science; Springer: Berlin/Heidelberg, Germany, 1985; pp. 62–76. ISBN 978-3-642-69968-9. [Google Scholar]
  81. Murata, T. Petri Nets: Properties, Analysis and Applications. Proc. IEEE 1989, 77, 541–580. [Google Scholar] [CrossRef]
  82. Gomes, L. On Conflict Resolution in Petri Nets Models through Model Structuring and Composition. In Proceedings of the 2005 3rd IEEE International Conference on Industrial Informatics, Perth, Australia, 10–12 August 2005; pp. 489–494. [Google Scholar]
  83. Gomes, L.; Moutinho, F.; Pereira, F. IOPT-Tools—A Web Based Tool Framework for Embedded Systems Controller Development Using Petri Nets. In Proceedings of the 2013 23rd International Conference on Field programmable Logic and Applications, Porto, Portugal, 2–4 September 2013; p. 1. [Google Scholar]
  84. Knottenbelt, W. PIPE v2. 5: A Petri Net Tool for Performance Modelling. In Proceedings of the 23rd Latin American Conference on Informatics (CLEI 2007), San José, Costa Rica, 9–12 October 2007; Faculty of Law, Josip Juraj Strossmayer University in Osijek: Osijek, Croatia, 2007; Volume 12. [Google Scholar]
  85. Amparore, E.G.; Balbo, G.; Beccuti, M.; Donatelli, S.; Franceschinis, G. 30 Years of GreatSPN. In Principles of Performance and Reliability Modeling and Evaluation: Essays in Honor of Kishor Trivedi on His 70th Birthday; Fiondella, L., Puliafito, A., Eds.; Springer Series in Reliability Engineering; Springer International Publishing: Cham, Switzerland, 2016; pp. 227–254. ISBN 978-3-319-30599-8. [Google Scholar]
  86. Pereira, F.; Moutinho, F.; Gomes, L. IOPT-Tools—Towards Cloud Design Automation of Digital Controllers with Petri Nets. In Proceedings of the 2014 International Conference on Mechatronics and Control (ICMC), Jinzhou, China, 3–5 July 2014; pp. 2414–2419. [Google Scholar]
  87. Pereira, F.; Moutinho, F.; Costa, A.; Barros, J.-P.; Campos-Rebelo, R.; Gomes, L. IOPT-Tools—From Executable Models to Automatic Code Generation for Embedded Controllers Development. In Proceedings of the Application and Theory of Petri Nets and Concurrency, Bergen, Norway, 19–24 June 2022; Bernardinello, L., Petrucci, L., Eds.; Springer International Publishing: Cham, Switzerland, 2022; pp. 127–138. [Google Scholar]
  88. Wiśniewski, R.; Bazydło, G.; Wojnakowski, M.; Popławski, M. Hippo-CPS: A Tool for Verification and Analysis of Petri Net-Based Cyber-Physical Systems. In Proceedings of the Application and Theory of Petri Nets and Concurrency, Lisbon, Portugal, 25–30 June 2023; Gomes, L., Lorenz, R., Eds.; Springer Nature: Cham, Switzerland, 2023; pp. 191–204, ISBN 978-3-031-33619-5. [Google Scholar]
  89. Minato, S. Binary Decision Diagrams and Applications for VLSI CAD; Kluwer Academic Publishers: New York, NY, USA, 1996; ISBN 0-7923-9652-9. [Google Scholar]
  90. Salu, N.U.; Oke, S.; Ohtake, H. Impact of Overloading of Photovoltaic Arrays on the Evaluation of Photovoltaic Power Generation Forecasts. Electr. Power Syst. Res. 2023, 214, 108930. [Google Scholar] [CrossRef]
  91. Mulenga, E.; Bollen, M.H.J.; Etherden, N. Limits Set by Component Loadability on Solar Power Integration in Distribution Networks. Electr. Power Syst. Res. 2022, 209, 107951. [Google Scholar] [CrossRef]
  92. Kamran, M.; Wattimena, R.K.; Armaghani, D.J.; Asteris, P.G.; Jiskani, I.M.; Mohamad, E.T. Intelligent Based Decision-Making Strategy to Predict Fire Intensity in Subsurface Engineering Environments. Process Saf. Environ. Prot. 2023, 171, 374–384. [Google Scholar] [CrossRef]
  93. Ullah, B.; Kamran, M.; Rui, Y. Predictive Modeling of Short-Term Rockburst for the Stability of Subsurface Structures Using Machine Learning Approaches: T-SNE, K-Means Clustering and XGBoost. Mathematics 2022, 10, 449. [Google Scholar] [CrossRef]
  94. Kamran, M.; Shahani, N.M. Decision Support System for the Prediction of Mine Fire Levels in Underground Coal Mining Using Machine Learning Approaches. Min. Metall. Explor. 2022, 39, 591–601. [Google Scholar] [CrossRef]
  95. Xilinx—Adaptable. Intelligent|Together We Advance_. Available online: https://www.xilinx.com/ (accessed on 2 November 2022).
  96. Collaborative Benchmarking And Experimental Algorithmics Laboratory A Benchmark Set. Available online: https://ddd.fit.cvut.cz/www/prj/Benchmarks/ (accessed on 1 April 2024).
Figure 1. The proposed design method flowchart.
Figure 1. The proposed design method flowchart.
Applsci 14 05212 g001
Figure 2. An exemplary concurrent control system modeled by an interpreted Petri net   N 1 .
Figure 2. An exemplary concurrent control system modeled by an interpreted Petri net   N 1 .
Applsci 14 05212 g002
Figure 3. Exemplary BDDs illustrating functions driving equivalent flip-flops: (a) the same excitation functions; (b) different excitation functions but equivalent flip-flops.
Figure 3. Exemplary BDDs illustrating functions driving equivalent flip-flops: (a) the same excitation functions; (b) different excitation functions but equivalent flip-flops.
Applsci 14 05212 g003
Figure 4. Equivalence of flip-flops: (a) simple; (b) hidden; (c) cofactored form.
Figure 4. Equivalence of flip-flops: (a) simple; (b) hidden; (c) cofactored form.
Applsci 14 05212 g004
Figure 5. Simple decomposition process with BDD: (a) cutting of diagram f, (b) upper part replaced with g functions, (c) encoding of functions g, (d) schema of the final decomposition.
Figure 5. Simple decomposition process with BDD: (a) cutting of diagram f, (b) upper part replaced with g functions, (c) encoding of functions g, (d) schema of the final decomposition.
Applsci 14 05212 g005
Figure 6. Iterative decomposition with BDD: (a) cutting of diagram f, (b) encoding of g1 and g2, (c) replacement of the upper part with g1 and g2 functions, (d) encoding of g3, (e) replacement of the upper part with g3 function, (f) schema of the final decomposition.
Figure 6. Iterative decomposition with BDD: (a) cutting of diagram f, (b) encoding of g1 and g2, (c) replacement of the upper part with g1 and g2 functions, (d) encoding of g3, (e) replacement of the upper part with g3 function, (f) schema of the final decomposition.
Applsci 14 05212 g006
Figure 7. Searching for shared g functions: (a,b) functions f1 and f2 and corresponding circuit partitions, (c) merged multiterminal diagram f1f2, (d) column patterns, (e) compatibility graph, (f) circuit with shared g1′.
Figure 7. Searching for shared g functions: (a,b) functions f1 and f2 and corresponding circuit partitions, (c) merged multiterminal diagram f1f2, (d) column patterns, (e) compatibility graph, (f) circuit with shared g1′.
Applsci 14 05212 g007
Figure 8. Model of a smart photovoltaic system.
Figure 8. Model of a smart photovoltaic system.
Applsci 14 05212 g008
Figure 9. An interpreted Petri net model of the discussed photovoltaic system.
Figure 9. An interpreted Petri net model of the discussed photovoltaic system.
Applsci 14 05212 g009
Figure 10. Specification of a single (1st) module (a part of the system).
Figure 10. Specification of a single (1st) module (a part of the system).
Applsci 14 05212 g010
Figure 11. Logical functions status_e after the decomposition (functions g are highlighted).
Figure 11. Logical functions status_e after the decomposition (functions g are highlighted).
Applsci 14 05212 g011
Figure 12. Logical synthesis and implementation of the system within Vivado 2023.1.
Figure 12. Logical synthesis and implementation of the system within Vivado 2023.1.
Applsci 14 05212 g012
Figure 13. Validation of the designed photovoltaic system.
Figure 13. Validation of the designed photovoltaic system.
Applsci 14 05212 g013
Figure 14. Hardware validation of the designed photovoltaic system with Nexys4 DDR board.
Figure 14. Hardware validation of the designed photovoltaic system with Nexys4 DDR board.
Applsci 14 05212 g014
Table 1. Association between transitions and input signals of the interpreted Petri net.
Table 1. Association between transitions and input signals of the interpreted Petri net.
Input SignalTransitionDescription
e 1 t 5 1st module is enabled
! e 1 t 6 1st module is disabled
p w 1 t 108 Power from 1st module is correct
! p w 1 t 10 Power from 1st module is not correct
t p 1 t 14 Temperature of 1st module is correct
! t p 1 t 13 Temperature of 1st module is not correct
Table 2. Association between output signals and places of the interpreted Petri net.
Table 2. Association between output signals and places of the interpreted Petri net.
Output Signal/VariablePlaceDescription
3 : 0 s t a t u s e p 18 Number of enabled modules counted
3 : 0 s t a t u s p p 19 Number of panels with correct power
3 : 0 s t a t u s t p 20 Number of panels with correct temperature
Table 3. Comparison of the utilized FPGA resources.
Table 3. Comparison of the utilized FPGA resources.
ResourcesProposed TechniqueTraditional Technique [13,41,43]
Number of utilized LUTs91126
Number of utilized FFs114114
Number of utilized IOs3838
Number of utilized BUFGs11
Table 4. Comparison of synthesis results with academic tools.
Table 4. Comparison of synthesis results with academic tools.
BenchmarksNumber of Blocks
NameInOutDecompABCDAOmapDDBDDBDS–PGA 2.0MultiDecPdekBDD
5xp17101323 19141410
9sym91 62 8755
alu2108 22 70412218
alu4148 41310651244190 324
apex4919 6979311314 362
apex613599 181 249186 188
apex74937 98 11371 50
b12159 19 2314
b9165 36 5540 38
clip951649 32301916
cm162a1451811 117
cm85a113 11 157
cht4736 37 2323
count3516 50 5026 37
duke22229 177 208173 189
ex10101010 73435674456 523
f51m881426 167
inc792427 2115
misex1871416 1414118
misex31414 6999801224 308
pcle199 16 1616
pdc1640 15632224042 184
rd7373617 54
rd84841045 161387
sao2 2436 21
spla1646 23727343243 265
sqrt884 11 67
t481161 13 5545
x21071713 1310
156 105
3235 2306
Sum of blocks 11,568 1966
15,048 2537
810 895
232179
Ratio of blocks sum1.491.405.885.930.911.301.00
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wiśniewski, R.; Opara, A.; Wojnakowski, M. Design and Optimization of a Petri Net-Based Concurrent Control System toward a Reduction in the Resources in a Field-Programmable Gate Array. Appl. Sci. 2024, 14, 5212. https://doi.org/10.3390/app14125212

AMA Style

Wiśniewski R, Opara A, Wojnakowski M. Design and Optimization of a Petri Net-Based Concurrent Control System toward a Reduction in the Resources in a Field-Programmable Gate Array. Applied Sciences. 2024; 14(12):5212. https://doi.org/10.3390/app14125212

Chicago/Turabian Style

Wiśniewski, Remigiusz, Adam Opara, and Marcin Wojnakowski. 2024. "Design and Optimization of a Petri Net-Based Concurrent Control System toward a Reduction in the Resources in a Field-Programmable Gate Array" Applied Sciences 14, no. 12: 5212. https://doi.org/10.3390/app14125212

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop