Internals: Merge from VHDL branch. Minor stuff, no functional change.
This commit is contained in:
parent
bca5d26583
commit
f13ffe2098
|
|
@ -964,6 +964,14 @@ public:
|
|||
setNOp1p(exprp);
|
||||
if (exprp) widthSignedFrom(exprp);
|
||||
}
|
||||
AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp)
|
||||
:AstNode(fl), m_svImplicit(false) {
|
||||
m_name = varname->name();
|
||||
m_pinNum = pinNum;
|
||||
m_modVarp = NULL;
|
||||
setNOp1p(exprp);
|
||||
if (exprp) widthSignedFrom(exprp);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(Pin, PIN)
|
||||
virtual void dump(ostream& str);
|
||||
virtual bool broken() const { return (m_modVarp && !m_modVarp->brokeExists()); }
|
||||
|
|
|
|||
|
|
@ -275,7 +275,6 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
virtual void visit(AstVar* nodep, AstNUser*) {
|
||||
cleanFileline(nodep);
|
||||
m_varp = nodep;
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ struct V3OptionsImp {
|
|||
set<string> m_incDirUserSet; // Include directories (for removing duplicates)
|
||||
list<string> m_incDirFallbacks; // Include directories (ordered)
|
||||
set<string> m_incDirFallbackSet; // Include directories (for removing duplicates)
|
||||
list<string> m_libExts; // Library extensions (ordered)
|
||||
set<string> m_libExtSet; // Library extensions (for removing duplicates)
|
||||
list<string> m_libExtVs; // Library extensions (ordered)
|
||||
set<string> m_libExtVSet; // Library extensions (for removing duplicates)
|
||||
DirMap m_dirMap; // Directory listing
|
||||
|
||||
// ACCESSOR METHODS
|
||||
|
|
@ -76,10 +76,10 @@ struct V3OptionsImp {
|
|||
}
|
||||
}
|
||||
}
|
||||
void addLibExt(const string& libext) {
|
||||
if (m_libExtSet.find(libext) == m_libExtSet.end()) {
|
||||
m_libExtSet.insert(libext);
|
||||
m_libExts.push_back(libext);
|
||||
void addLibExtV(const string& libext) {
|
||||
if (m_libExtVSet.find(libext) == m_libExtVSet.end()) {
|
||||
m_libExtVSet.insert(libext);
|
||||
m_libExtVs.push_back(libext);
|
||||
}
|
||||
}
|
||||
V3OptionsImp() {}
|
||||
|
|
@ -91,8 +91,8 @@ void V3Options::addIncDirUser(const string& incdir) {
|
|||
void V3Options::addIncDirFallback(const string& incdir) {
|
||||
m_impp->addIncDirFallback(incdir);
|
||||
}
|
||||
void V3Options::addLibExt(const string& libext) {
|
||||
m_impp->addLibExt(libext);
|
||||
void V3Options::addLibExtV(const string& libext) {
|
||||
m_impp->addLibExtV(libext);
|
||||
}
|
||||
void V3Options::addDefine(const string& defline) {
|
||||
// Split +define+foo=value into the appropriate parts and parse
|
||||
|
|
@ -304,7 +304,7 @@ string V3Options::fileExists (const string& filename) {
|
|||
}
|
||||
|
||||
string V3Options::filePathCheckOneDir(const string& modname, const string& dirname) {
|
||||
for (list<string>::iterator extIter=m_impp->m_libExts.begin(); extIter!=m_impp->m_libExts.end(); ++extIter) {
|
||||
for (list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
|
||||
string fn = filenameFromDirBase(dirname, modname+*extIter);
|
||||
string exists = fileExists(fn);
|
||||
if (exists!="") {
|
||||
|
|
@ -350,14 +350,14 @@ void V3Options::filePathLookedMsg(FileLine* fl, const string& modname) {
|
|||
fl->v3error("Looked in:"<<endl);
|
||||
for (list<string>::iterator dirIter=m_impp->m_incDirUsers.begin();
|
||||
dirIter!=m_impp->m_incDirUsers.end(); ++dirIter) {
|
||||
for (list<string>::iterator extIter=m_impp->m_libExts.begin(); extIter!=m_impp->m_libExts.end(); ++extIter) {
|
||||
for (list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
|
||||
string fn = filenameFromDirBase(*dirIter,modname+*extIter);
|
||||
fl->v3error(" "<<fn<<endl);
|
||||
}
|
||||
}
|
||||
for (list<string>::iterator dirIter=m_impp->m_incDirFallbacks.begin();
|
||||
dirIter!=m_impp->m_incDirFallbacks.end(); ++dirIter) {
|
||||
for (list<string>::iterator extIter=m_impp->m_libExts.begin(); extIter!=m_impp->m_libExts.end(); ++extIter) {
|
||||
for (list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
|
||||
string fn = filenameFromDirBase(*dirIter,modname+*extIter);
|
||||
fl->v3error(" "<<fn<<endl);
|
||||
}
|
||||
|
|
@ -685,10 +685,10 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
|||
string exts = string(sw+strlen("+libext+"));
|
||||
string::size_type pos;
|
||||
while ((pos=exts.find("+")) != string::npos) {
|
||||
addLibExt (exts.substr(0,pos));
|
||||
addLibExtV (exts.substr(0,pos));
|
||||
exts = exts.substr(pos+1);
|
||||
}
|
||||
addLibExt (exts);
|
||||
addLibExtV (exts);
|
||||
}
|
||||
else if ( !strcmp (sw, "+librescan")) { // NOP
|
||||
}
|
||||
|
|
@ -1208,9 +1208,9 @@ V3Options::V3Options() {
|
|||
|
||||
optimize(true);
|
||||
// Default +libext+
|
||||
addLibExt(""); // So include "filename.v" will find the same file
|
||||
addLibExt(".v");
|
||||
addLibExt(".sv");
|
||||
addLibExtV(""); // So include "filename.v" will find the same file
|
||||
addLibExtV(".v");
|
||||
addLibExtV(".sv");
|
||||
// Default -I
|
||||
addIncDirFallback("."); // Looks better than {long_cwd_path}/...
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ class V3Options {
|
|||
void addFuture(const string& flag);
|
||||
void addIncDirUser(const string& incdir); // User requested
|
||||
void addIncDirFallback(const string& incdir); // Low priority if not found otherwise
|
||||
void addLibExt(const string& libext);
|
||||
void addLibExtV(const string& libext);
|
||||
void optimize(int level);
|
||||
void showVersion(bool verbose);
|
||||
void coverage(bool flag) { m_coverageLine = m_coverageToggle = m_coverageUser = flag; }
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include <cstdarg>
|
||||
#include <unistd.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#include "V3Error.h"
|
||||
#include "V3Global.h"
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ struct V3ParseBisonYYSType {
|
|||
string* strp;
|
||||
int cint;
|
||||
double cdouble;
|
||||
bool cbool;
|
||||
V3UniqState uniqstate;
|
||||
AstSignedState signstate;
|
||||
V3ImportProperty iprop;
|
||||
|
|
|
|||
|
|
@ -1017,7 +1017,7 @@ word [a-zA-Z0-9_]+
|
|||
"`begin_keywords"[ \t]*\"1800-2005\" { yy_push_state(S05); PARSEP->pushBeginKeywords(YY_START); }
|
||||
"`begin_keywords"[ \t]*\"1800-2009\" { yy_push_state(S09); PARSEP->pushBeginKeywords(YY_START); }
|
||||
"`begin_keywords"[ \t]*\"1800+VAMS\" { yy_push_state(SA9); PARSEP->pushBeginKeywords(YY_START); }
|
||||
"`end_keywords" { yy_pop_state(); if (!PARSEP->popBeginKeywords()) yyerrorf("`end_keywords when not inside `begin_keywords block"); }
|
||||
"`end_keywords" { yy_pop_state(); if (!PARSEP->popBeginKeywords()) yyerrorf("`end_keywords when not inside `begin_keywords block"); }
|
||||
|
||||
/* Verilator */
|
||||
"`systemc_ctor" { BEGIN SYSCCTOR; }
|
||||
|
|
|
|||
|
|
@ -365,7 +365,18 @@ sub new {
|
|||
$self->{coverage_filename} ||= "$self->{obj_dir}/vlt_coverage.pl";
|
||||
$self->{vcd_filename} ||= "$self->{obj_dir}/sim.vcd";
|
||||
$self->{main_filename} ||= "$self->{obj_dir}/$self->{VM_PREFIX}__main.cpp";
|
||||
($self->{top_filename} = $self->{pl_filename}) =~ s/\.pl$/\.v/;
|
||||
($self->{top_filename} = $self->{pl_filename}) =~ s/\.pl$//;
|
||||
if (-e ($self->{top_filename}.".vhd")) { # If VHDL file exists
|
||||
$self->{vhdl} = 1;
|
||||
$self->{top_filename} .= ".vhd";
|
||||
} else {
|
||||
$self->{top_filename} .= ".v";
|
||||
}
|
||||
if (!$self->{make_top_shell}) {
|
||||
$self->{top_shell_filename} = $self->{top_filename};
|
||||
} else {
|
||||
$self->{top_shell_filename} = "$self->{obj_dir}/$self->{VM_PREFIX}__top.v";
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
|
@ -1170,7 +1181,7 @@ sub _sp_preproc {
|
|||
|
||||
sub _read_inputs_v {
|
||||
my $self = shift;
|
||||
my $filename = $self->{top_filename};
|
||||
my $filename = $self->top_filename;
|
||||
$filename = "$self->{t_dir}/$filename" if !-r $filename;
|
||||
my $fh = IO::File->new("<$filename") or die "%Error: $! $filename,";
|
||||
while (defined(my $line = $fh->getline)) {
|
||||
|
|
@ -1188,7 +1199,7 @@ sub _read_inputs_v {
|
|||
|
||||
sub _read_inputs_vhdl {
|
||||
my $self = shift;
|
||||
my $filename = $self->{top_filename};
|
||||
my $filename = $self->top_filename;
|
||||
$filename = "$self->{t_dir}/$filename" if !-r $filename;
|
||||
my $fh = IO::File->new("<$filename") or die "%Error: $! $filename,";
|
||||
while (defined(my $line = $fh->getline)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue