2012-04-13 01:08:20 +00:00
|
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//*************************************************************************
|
2009-10-31 14:08:38 +00:00
|
|
|
|
// DESCRIPTION: Verilator: Reading of Verilog files
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
2008-04-25 12:14:27 +00:00
|
|
|
|
// Code available from: http://www.veripool.org/verilator
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2018-01-02 23:05:06 +00:00
|
|
|
|
// Copyright 2003-2018 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.
|
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
2009-10-31 14:08:38 +00:00
|
|
|
|
#ifndef _V3PARSE_H_
|
|
|
|
|
#define _V3PARSE_H_ 1
|
2018-10-14 17:43:24 +00:00
|
|
|
|
|
2009-10-31 14:08:38 +00:00
|
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 17:43:24 +00:00
|
|
|
|
|
2009-10-31 14:08:38 +00:00
|
|
|
|
#include "V3Error.h"
|
|
|
|
|
#include "V3Global.h"
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2009-10-31 14:08:38 +00:00
|
|
|
|
class AstNetlist;
|
2010-01-20 12:15:51 +00:00
|
|
|
|
class V3InFilter;
|
2009-10-31 14:08:38 +00:00
|
|
|
|
class V3ParseImp;
|
2012-08-16 01:28:30 +00:00
|
|
|
|
class V3ParseSym;
|
2009-10-31 14:08:38 +00:00
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
|
|
class V3Parse {
|
|
|
|
|
private:
|
|
|
|
|
V3ParseImp* m_impp;
|
|
|
|
|
|
|
|
|
|
// CONSTRUCTORS
|
2017-11-01 22:51:41 +00:00
|
|
|
|
VL_UNCOPYABLE(V3Parse);
|
|
|
|
|
public:
|
2009-10-31 14:08:38 +00:00
|
|
|
|
// We must allow reading multiple files into one parser
|
2012-08-16 01:28:30 +00:00
|
|
|
|
V3Parse(AstNetlist* rootp, V3InFilter* filterp, V3ParseSym* symp);
|
2009-10-31 14:08:38 +00:00
|
|
|
|
~V3Parse();
|
|
|
|
|
|
|
|
|
|
// METHODS
|
|
|
|
|
// Preprocess and read the Verilog file specified into the netlist database
|
2011-10-28 00:56:38 +00:00
|
|
|
|
void parseFile(FileLine* fileline, const string& modname, bool inLibrary,
|
|
|
|
|
const string& errmsg);
|
2009-10-31 14:08:38 +00:00
|
|
|
|
|
|
|
|
|
// Push preprocessed text to the lexer
|
|
|
|
|
static void ppPushText(V3ParseImp* impp, const string& text);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // Guard
|