Вы находитесь на странице: 1из 5

Structural Design Composition for C++ Hardware Models

Frederic Doucet, Vivek Sinha, Rajesh Gupta

Center for Embedded Computer Systems


University of California at Irvine

fdoucet,vsinha,rguptag@ics.uci.edu

Abstract These are essentially structural concerns, and the new


emerging languages do not have the semantics to capture
This paper addresses the modeling of layout structure the information needed to do timing based design[3]. For
in high level C++ models. Researchers agree that the example, wire lengths and block placements are not cap-
level of abstraction for integrated circuit design needs to be tured in functional specification where blocks and wires are
raised. New languages and methodologies are being pro- not yet necessarily identified or allocated.
posed, most of them influenced from the software engineer- The connection between C level modeling and physical
ing domain. However, one of the fundamental hardware de- design is discussed in [8] and in [5]. However, no clear path
sign challenges is often overlooked as push button synthesis has yet emerged for the integration of the structural physi-
solutions are sought: physical design predictability. In this cal information in high level languages. In this paper, we
paper we describe how C++ constructs should be used to will discuss a semantical approach to specify the structural
capture structural and physical implementation concerns. implementation information in high level models. The im-
Our explanation relies on the importance of the floorplan plementation of the syntax is based on using an object hier-
and component placement estimations at high levels of ab- archy to reflect the physical structure of the implementation
straction. We highlight how using object oriented mecha- as a structural object model. We present the Incidence Com-
nisms eases the structural modeling of circuit components, position Structure Project class library to capture layout and
and we present a C++ class library design to specify these floorplanning information in C++ models.
structural concerns.
2. Languages and Semantics

1. Introduction Many hardware design methodologies and tools with


variants of C/C++ or Java have been proposed in the re-
cent years. The semantical outlines we can clearly distin-
High level modeling using C/C++ models [11] [2] has guish for structural composition in the main languages are
been proven efficient for architecture exploration and verifi- the following:
cation, and the implementability of these models progresses
as their productivity gains are demonstrated to engineers 1. VHDL and Verilog: formal structural semantic for pro-
and managers. cess networks and strong connectivity through signals;
Although complexity is often cited as the primary design
concern, building floorplans and layouts is also a challenge 2. C: informal semantics, a program is a set of functions
since it is difficult to abstract and to predict in a behavioral with a set of global data structures;
specification. A design step such as place and route is both 3. C++ and Java: informal semantics, the C functional
hard and time consuming in deep submicron designs [6]. space augmented with the “object” space where data
Timing closure is very difficult when a design goes from and functionality is encapsulated.
logical to geometrical granularity, since most of the weight
of timing analysis is now a function of the lengths of the in- VHDL, Verilog and their variants are well established
terconnection between gates rather than by the gates them- for RTL design and have yielded many successful designs
selves. over the years. Although their synthesizable semantics are
known and understood, these language are not the best ones A netlist is an example of some of these kinds of struc-
for architectural exploration because of their strong connec- ture. In addition to juxtaposition relationships such as “part
tivity and their lack of functional hierarchy. It is interest- A adjoins, and is to the left of, part B”, structure can include
ing to note that variants of C such as Superlog [12] and more detailed information such as component size and rout-
SpecC [2] add semantical constructs over the functional de- ing channels.
sign space of C through the usage of keywords. These con- The structure which we consider in this project consists
structs (such as a Behavior in SpecC) have special semanti- of component hierarchy and juxtaposition. While other as-
cal meaning recognizable by the designers and the tools. In pects of structure can be useful to a designer, we have cho-
C++, the designer can build such semantical constructs by sen to begin the exploration of structure-added descriptions
using classes. The SystemC and Cynlib class libraries are with juxtaposition.
used to give objects process interfaces and to build the de- The approach to describe the structure is to rely on rect-
sign in an environment where a reactive simulation kernel angle partitioning. Each component is considered to have a
can invoke the design entities. rectangular outline. The placement description involves the
subdivision of a component’s rectangle. An example subdi-
2.1. Desirable Semantics vision, or partitioning, description might be the following:
 Part A is decomposed into parts B and C with B to the
A good hardware design language should have the se-
left of C
mantics highlighted in [4] available in its syntax: reactivity,
concurrency, composability and binary data types. The lan- Thus, rectangle partitioning description can combine
guage choice will have to be made by each company indi- both hierarchy specification and placement. Alternatively,
vidually, according to the application domain, interoperabil- in some circumstances it may be appropriate to ignore
ity concerns and their design process. For more information placement for the moment. In the above example, such a
about semantics, the reader is invited to read the Accelera description might be the following:
[9] FSMD for semantical proposal information, and for in-
teroperability the IEEE DATC [10] effort.  Part A is decomposed into parts B and C
The rectangle partitioning style does not handle fuzzy
2.2. Why Object Orientation Helps structural relationships very well. On the other hand, it
is pretty easy to visualize and understand. The results of
The main object oriented design philosophy is to map changes are fairly intuitive. Also, it is obvious that such a
the object structure of a problem into an object structure structural description results in a flat component layout. No
in the software model. Hence, a hardware structure can planarity testing required.
be mapped directly to an object structure with a one-to-one A partitioning concept such as “to the left of” is both
correspondence between the objects of both domains. This simple to visualize and understand, and it is fairly easy to
object structure in the model can be analyzed and annotated implement. There are two directions in which to perform a
with information. This is how object models are extendible 2-for-1 type of partition, either horizontally or vertically.
without disrupting the existing tools. The most common such partitioning is a 1-dimensional
array partition. It is common to stack, or abut, more than
3. Structural Layout two components in a placement array. Describing this in
terms of binary partitions is quite cumbersome. Thus, we
Structure involves the connectedness of components, the consider that being able to describe the partition of a rect-
orientation and how they are connected. In a high level angle into any number of horizontal sub-components (or
design language, a designer must describe several types of vertical sub-components) is important. This array partition-
structure: ing allows the clustering of components at the same level
where they are conceptually equal – e.g., layout of an array
 what components nest inside others – parent-child re- of pipeline stages.
lationships For this work, we chose to represent the hierarchical
containment of components by rectangles and their relative
 how sub-components are juxtaposed – sibling relation- placement. The structure is specified using a slicing tree [7]
ships e.g., the incidence structure in terms of north, consisting of horizontal and vertical composition of rectan-
south, east, west gles. Figure1 shows an instance of rectangle partitioning
 what ports are attached to the component and the corresponding slicing tree. A component can be
split either horizontally or vertically into subcomponents,
 where on the component those ports are attached and each of those subcomponents can be split further. On
A B The icsp module class provides the ability to indicate
both port locations and the layout of sub-components. An
object of class ICSP module is treated as a rectangle. The
C
G H E attachment locations on the edges of the rectangle can be
specified for each of its ports. Sub-components can either
subdivide the rectangle horizontally or vertically, but not
D F both. To effect subdivision in both directions one more layer
of hierarchy is required in the description – for example, to
create a 2x2 subdivision a dummy layer of two dummy sub-
(a) components could split the rectangle horizontally (i.e., side-
by-side) and then the left dummy sub-component could be
T Vertical Cut split vertically into the two actual sub-components in the
left 2x2 column, and similarly in the right dummy sub-
component for the other two actual sub-components. Note
Horizontal Cut A B Horizontal Cut
that sub-components are typically specializations of the
SystemC module class class. These specializations can in-
Vertical Cut C D E F
clude other icsp module instances or SystemC module in-
stances. We will walk through an example of the composi-
G H tion of a DLX pipeline to illustrate the usage of the ICSP
classes.
(b)

Figure 1. Component order and placement: 4.1. Composite Nodes


(a) Rectangle partitioning, (b) Corresponding
Slicing Tree Only composite nodes of the split tree can be horizon-
tally or vertically split. An ICSP module is a composite
node.

EX
EX fwd ALU
Figure1(a), we see that the top level component T is split
horizontally into subcomponents A and B, through a verti- from ID
clk
to MEM
cal cut. Subcomponent B is split vertically into subcompo- BShift & fwd
nents E and F through a horizontal cut. The slicing tree on
clk
Figure1(b) shows the top node and the child nodes. Com- clk
clk
posite nodes (the nodes that are split) are decorated with the
cut type, valued horizontal or vertical. The location of input
and output ports is specified on the sides of a component, Figure 2. Vertical split and port locations for
but it does not appear on this tree. EX stage

4. ICSP Structure Extensions Figure 2 shows the usage of an icsp module to group
sub-modules together with signal placement. This is a
Modeling structure in our project, involves describing grouping of two functional units, themselves ICSP module
two different kinds of things: the subdividing of a compo- class. This is the ICSP equivalent of the SystemC module.
nent into sub-components with relative placement, and the The module is an EX pipeline stage and the sub-module are
mapping of a component’s ports onto locations around the two functional units, ALU and BShift, laid out vertically
periphery of that component. For the implementation of the within the module. The three incoming signals are located
classes, we choose to start with the SystemC [11] C++ class on the left side low, middle and high areas of the EX mod-
interfaces. ule’s periphery. These signals are then split and passed into
While SystemC provides the concept of hierarchical con- the sub-modules. All classes include signal placement. This
tainment, missing are the concepts of relative placement of figure corresponds to the source code of “struct stage ex”.
modules and the attachment or placement of ports with re- The code below shows how the partitioning and port at-
spect to their components. In addition, ICSP introduces tachments shown in Figure 2 are described in an ICSP class.
component and port classes to support the representation of The syntactic elements beginning “icsp ” refer to ICSP li-
placement on par with the module class. brary parts. The functional units are called alu1 and bsh1.
struct stage_ex : public icsp_module { 4.2. Leaf Nodes
alu alu1; // sub-modules: both EX stage functional
BShift bsh1; The code fragments defining the sub-module classes, alu
icsp_inport< bool > clk
and bsu, look similar to this icsp module with the exception
icsp_inport< t_id_ex_reg > id_ex_in; that it is a leaf component in the slicing tree: it does not
icsp_inport< t_ex_mem_reg > ex_mem_in;
icsp_ouport< t_ex_mem_reg > ex_mem_out; have sub-components. For example, the alu code, shown
below, inherits from icsp leaf module
// constructor.
stage_ex( const char * NAME ) struct alu : public icsp_leaf_module {
icsp_inport< bool > clk;
// Initialize base module: icsp_inport< t_id_ex_reg > id_ex_in;
// 1. rectangle partition icsp_inport< t_ex_mem_reg > ex_mem_in;
: icsp_module( name, icsp_ouport< t_ex_mem_reg > ex_mem_out;
ICSP_SPLIT_VERTICALLY,
icsp_corder( icsp_comp( alu1 ), //Constructor
icsp_comp( bsh1 ) ), alu( const char *NAME )
: icsp_sync(NAME,
// 2. Port placement. icsp_porder(
icsp_porder( icsp_ppair( clk, ICSP_LOWER_LEFT ),
icsp_ppair( clk, ICSP_LOWER_LEFT ), icsp_ppair( id_ex_in, ICSP_UPPER_LEFT ),
icsp_ppair( id_ex_in, ICSP_UPPER_LEFT ), icsp_ppair( ex_mem_in, ICSP_MID_LEFT ),
icsp_ppair( ex_mem_in, ICSP_MID_LEFT ), icsp_ppair( ex_mem_out, ICSP_UPPER_RIGHT ))
icsp_ppair( ex_mem_out, ICSP_UPPER_RIGHT )) )
) ...
...

As can be seen, the base icsp leaf module class initial-


This stage ex class is inherited from the icsp module
ization looks similar to the icsp module class initialization
class, which itself inherits from SystemC sc module class.
for a composite node. It includes the signal placement
The two sub-processes, the ALU and the barrel shifter are
via icsp porder but it is missing the physical sub-division
defined as internal to this EX stage. Next are four ICSP
via icsp corder. This alu module could also inherit from
ports declarations. The rest of the code is a C++ constructor
sc module if there was no port location information.
definition for the module. This constructor takes one argu-
ment, the instance name of the module. After the module
name, the icsp module class initialization consists of a sub- 4.3. Putting it all together
division of the module vertically followed by both the order
Let us now complete the pipeline by composing it from
of the sub-components within the module. its submodules. The following code is the implementation
The alu1 and bsh1 sub-processes are each wrapped in an of the pipeline composition:
icsp comp class which supports a simple daisy-chain link- struct dlx_pipeline : public icsp_module {
age, a simple mechanism to allow ICSP to track the order
of the horizontal or vertical stack of sub-parts comprising // sub-modules
stage_if IF;
the module. The icsp corder function performs the compo- stage_id ID;
nent ordering and linking. Sub-parts of an ICSP module can stage_ex EX;
stage_mem MEM;
be either SystemC or ICSP flavors. In either case, each is stage_wb WB;
wrapped in an ICSP component class.
icsp_inport<bool> clk;
The base icsp module class initialization ends with the
specification of port locations: the placement of the in- // constructor.
dlx_pipeline( const char * NAME )
coming and outgoing signals on the periphery of the mod-
ule. Each port is associated with a module rectangle lo- : icsp_module( name,
// 1. rectangle partition
cation. These combinations are called port-location pairs. ICSP_SPLIT_HORIZONTALLY,
In this example, the clock port, is placed at the lower left icsp_corder( icsp_comp( IF ),
icsp_comp( ID ) ,
edge, ICSP LOWER LEFT, of the stage ex module rect- icsp_comp( EX ) ,
angle. This locating or placement is performed by the icsp_comp( MEM ) ,
icsp_comp( WB ) ),
icsp ppair function. This function takes as arguments a sig-
nal or channel of some type and, as a second argument, a lo- // 2. Port placement.
icsp_porder(
cation enumeration value. As with the icsp comp wrapper icsp_ppair( clk, ICSP_LOWER_LEFT ))
class, the icsp ppair wrapper class provides a daisy-chain )
...
linkage. The icsp porder function serves to keep track of
the port-location pairs in the ICSP module. The remainder Since the pipeline is a composite module, it also de-
of the code of the constructor is omitted because it is not rives from the ICSP module class. The composed nodes
related to the ICSP features. are the ID, IF, EX, MEM and WB stages. The pipeline has
one explicit input, the clock signal. In the constructor, the crcuits. IEEE Transactions on Computer-Aided Design of
pipeline is first split horizontally and the components are Integrated Circuits ans Systems, September 1999.
daisy chained from left to right. Secondly, the clk port is [2] D. D. Gajski, R. Domer, and J. Zhu. Ip-centri methodol-
placed in the lower left corner of the outer rectangle. Figure ogy and design with the specc language. In System-Level
Synthesis. Kluwer Academic Publishers, 1999.
3 illustrates the geometrical composition and port location
[3] R. K. Gupta. Timing-driven system design. In CS Workshop
information. on VLSI, April 1999.
Pipeline Branch-Taken [4] R. K. Gupta and S. Y. Liao. Using a programming language
+ ALU-output
for digital system design. IEEE Design and Test of Comput-
EX
ALU ALU ers, April-June 1997.
-output

IF ID MEM WB
[5] T. Kam, S. Rawat, D. Kirkpatrick, R. Roy, G. S. Spirakis,
clk
N. Sherwani, and C. Peterson. Eda challenges facing future
clk clk
BShift
clk clk microprocessor design. IEEE Transactions on Computer-
clk Aided Design of Integrated Circuits and Systems, December
clk clk 2000.
D-Mem
[6] D. Sylvester and K. Keutzer. Getting to the bottom of deep
I-Mem
submicron. In International Conference on Computer-Aided
Reg File
Design, 1998.
[7] S. Tarafdar and M. Lesser. A data-centri approach to high-
Figure 3. Horizontal split and port locations level synthesis. IEEE Transactions on Computer-Aided De-
for DLX pipeline sign of Integrated Circuits and Systems, November 2000.
[8] K. Wakabayashi and T. Okamoto. C-based soc design flow
and eda tools: An asic and system vendor perspective. IEEE
Transactions on Computer-Aided Design of Integrated Cir-
cuits and Systems, December 2000.
5. Conclusion [9] Accelera C/C++ Class Library Standardization Working
Group home page: http://www.eda.org/alc-wgp.
In this paper, we first highlighted the importance of [10] IEEE/DATC C++ Modeling Standardization Effort home
structural information in high level models. Then, we gave page: http://www.ics.uci.edu/ rgupta/datc/.
an overview of what structural information is capturable in [11] SystemC home page: http://www.systemc.org.
currently available languages. Then, we defined a set of [12] The Superlog Language home page:
http://www.superlog.org/.
semantics to capture the structural information for layout
composition. Finally, we described an implementation of
these semantics in the ICSP class library.
This information can be useful on the multiple levels of
floorplanning activity: overall chip layout, optimization of
individual cores and critical path optimization. The primary
use of the ICSP library is in definition of structure to aid
the design and synthesis of structural blocks, for data flow
or structurally regular datapath designs [1]. Future work is
to use the ICSP class interfaces to characterize RTL class
libraries to do datapath composition and to add cell size and
wire length attributes.

6. Acknowledgments

The authors would like to acknowledge the work of


Chuck Siska for the initial version of the ICSP library. The
authors would like to acknowledge support from National
Science Foundation award number NSF CCR-9806898,
from DARPA/ITO DABT63-98-C-004.

References
[1] A. Chowdhary, S. Kale, P. K. Saripella, N. K. Sehgal, and
R. K. Gupta. Extraction of functional regularity in datapath

Вам также может понравиться