2008-06-10 01:25:10 +00:00
|
|
|
|
// -*- C++ -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//*************************************************************************
|
|
|
|
|
// DESCRIPTION: Verilator: Node attributes/ expression widths
|
|
|
|
|
//
|
2008-04-25 12:14:27 +00:00
|
|
|
|
// Code available from: http://www.veripool.org/verilator
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
// AUTHORS: Wilson Snyder with Paul Wasson, Duane Gabli
|
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2012-01-15 15:26:28 +00:00
|
|
|
|
// Copyright 2003-2012 by Wilson Snyder. This program is free software; you can
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
// Version 2.0.
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
// Verilator is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
|
|
|
|
#ifndef _V3WIDTH_H_
|
|
|
|
|
#define _V3WIDTH_H_ 1
|
2006-12-18 19:20:45 +00:00
|
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2006-08-26 11:35:28 +00:00
|
|
|
|
#include "V3Error.h"
|
|
|
|
|
#include "V3Ast.h"
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
|
|
class V3Width {
|
|
|
|
|
public:
|
|
|
|
|
static void width(AstNetlist* nodep);
|
|
|
|
|
// Smaller step... Only do a single node for parameter propagation
|
2009-10-15 00:13:04 +00:00
|
|
|
|
static AstNode* widthParamsEdit(AstNode* nodep);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// Final step... Mark all widths as equal
|
2009-10-02 02:33:11 +00:00
|
|
|
|
static void widthCommit(AstNetlist* nodep);
|
2009-10-25 20:53:55 +00:00
|
|
|
|
|
|
|
|
|
// For use only in WidthVisitor
|
|
|
|
|
// Replace AstSelBit, etc with AstSel/AstArraySel
|
|
|
|
|
// Returns replacement node if nodep was deleted, or null if none.
|
|
|
|
|
static AstNode* widthSelNoIterEdit(AstNode* nodep);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // Guard
|