2012-04-13 03:08:20 +02:00
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2006-08-26 13:35:28 +02:00
|
|
|
//*************************************************************************
|
2009-10-31 15:08:38 +01:00
|
|
|
// DESCRIPTION: Verilator: Reading of Verilog files
|
2006-08-26 13:35:28 +02:00
|
|
|
//
|
2019-11-08 04:33:59 +01:00
|
|
|
// Code available from: https://verilator.org
|
2006-08-26 13:35:28 +02:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2020-03-21 16:24:24 +01:00
|
|
|
// Copyright 2003-2020 by Wilson Snyder. This program is free software; you
|
|
|
|
|
// can redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 23:07:57 +02:00
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
// Version 2.0.
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2006-08-26 13:35:28 +02:00
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
2019-10-05 02:17:11 +02:00
|
|
|
|
2009-10-31 15:08:38 +01:00
|
|
|
#ifndef _V3PARSE_H_
|
|
|
|
|
#define _V3PARSE_H_ 1
|
2018-10-14 19:43:24 +02:00
|
|
|
|
2009-10-31 15:08:38 +01:00
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 19:43:24 +02:00
|
|
|
|
2009-10-31 15:08:38 +01:00
|
|
|
#include "V3Error.h"
|
|
|
|
|
#include "V3Global.h"
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2009-10-31 15:08:38 +01:00
|
|
|
class AstNetlist;
|
2019-10-05 13:54:14 +02:00
|
|
|
class VInFilter;
|
2009-10-31 15:08:38 +01:00
|
|
|
class V3ParseImp;
|
2012-08-16 03:28:30 +02:00
|
|
|
class V3ParseSym;
|
2009-10-31 15:08:38 +01:00
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
|
|
class V3Parse {
|
|
|
|
|
private:
|
2018-10-27 16:03:28 +02:00
|
|
|
V3ParseImp* m_impp;
|
2009-10-31 15:08:38 +01:00
|
|
|
|
|
|
|
|
// CONSTRUCTORS
|
2017-11-01 23:51:41 +01:00
|
|
|
VL_UNCOPYABLE(V3Parse);
|
2020-03-16 04:20:33 +01:00
|
|
|
|
2017-11-01 23:51:41 +01:00
|
|
|
public:
|
2009-10-31 15:08:38 +01:00
|
|
|
// We must allow reading multiple files into one parser
|
2019-10-05 13:54:14 +02:00
|
|
|
V3Parse(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* symp);
|
2009-10-31 15:08:38 +01:00
|
|
|
~V3Parse();
|
|
|
|
|
|
|
|
|
|
// METHODS
|
|
|
|
|
// Preprocess and read the Verilog file specified into the netlist database
|
2011-10-28 02:56:38 +02:00
|
|
|
void parseFile(FileLine* fileline, const string& modname, bool inLibrary,
|
2018-10-27 16:03:28 +02:00
|
|
|
const string& errmsg);
|
2009-10-31 15:08:38 +01:00
|
|
|
|
|
|
|
|
// Push preprocessed text to the lexer
|
|
|
|
|
static void ppPushText(V3ParseImp* impp, const string& text);
|
|
|
|
|
};
|
|
|
|
|
|
2018-10-27 16:03:28 +02:00
|
|
|
#endif // Guard
|