4 * Copyright (c) 2006 Stephen Williams <steve@icarus.com>
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22 #ident "$Id: PSpec.h,v 1.3 2007/04/13 02:34:35 steve Exp $"
25 # include "LineInfo.h"
26 # include "StringHeap.h"
32 * The PSpecPath is the parse of a specify path, which is in its most
33 * general form <path> = <delays>. The <delays> are collected into the
34 * "delays" vector in all cases, and the variety is in the other
37 * All paths also have a list of source names in the src vector, and a
38 * list of destination names in the dst vector. These pairs are the
41 * If the path is a simple path, then:
44 * data_source_expression == nil
46 * If the path is conditional, then conditional == true and condition
47 * is the condition expression. If the condition expression is nil,
48 * then this is an ifnone conditional path.
50 * If data_source_expression != nil, then the path is edge sensitive
51 * and the edge might not be 0.
53 class PSpecPath
: public LineInfo
{
56 PSpecPath(unsigned src_cnt
, unsigned dst_cnt
);
59 void elaborate(class Design
*des
, class NetScope
*scope
) const;
61 void dump(std::ostream
&out
, unsigned ind
) const;
64 // Condition expression, if present.
66 class PExpr
* condition
;
67 // Edge specification (-1==negedge, 0 = no edge, 1==posedge)
69 // Ordered set of source nodes of a path
70 std::vector
<perm_string
> src
;
71 // Ordered set of destination nodes of a path
72 std::vector
<perm_string
> dst
;
73 // Data source expression
74 class PExpr
* data_source_expression
;
76 std::vector
<class PExpr
*>delays
;