Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MiniEDA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
MiniEDA
Commits
53ca0b2d
Commit
53ca0b2d
authored
Dec 27, 2022
by
lvzhengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
successfully build verilog_parser, bugs may remain
parent
f3b3e75e
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
20 deletions
+43
-20
pkgs
+1
-1
src/db_mgr/include/db_mgr/db_mgr.h
+4
-2
src/db_mgr/src/db_mgr.cpp
+12
-7
src/db_mgr/src/db_mgr.i
+3
-1
src/db_mgr/src/db_mgr.tcl
+1
-1
src/db_mgr/src/parsers/verilog_parser/CMakeLists.txt
+11
-4
src/db_mgr/src/parsers/verilog_parser/verilog_database.cpp
+2
-0
src/db_mgr/src/parsers/verilog_parser/verilog_database.h
+1
-1
src/db_mgr/src/parsers/verilog_parser/verilog_parser.cpp
+5
-2
src/db_mgr/src/parsers/verilog_parser/verilog_parser.h
+3
-1
No files found.
pkgs
@
aacb621d
Subproject commit
349d19ffd130ecb85547e7a55cc914b01e63cc69
Subproject commit
aacb621dc300c5bc8ba108fb86f6f7d791e859fa
src/db_mgr/include/db_mgr/db_mgr.h
View file @
53ca0b2d
...
...
@@ -63,8 +63,10 @@ public:
bool
cont_on_err
,
bool
is_floorplan
,
bool
is_incr
);
// incr: incremental
bool
readVerilog
(
const
char
*
design_name
,
const
char
*
v_file
);
// bool readVerilog(const char* design_name,
// const char* v_file);
bool
readVerilog
(
const
std
::
string
&
design_name
,
const
std
::
string
&
v_file
);
void
setCurrentBlock
(
const
char
*
design
);
void
setCurrentBlock
(
odb
::
dbDatabase
*
db
);
...
...
src/db_mgr/src/db_mgr.cpp
View file @
53ca0b2d
...
...
@@ -5,6 +5,8 @@
#include "utl/Logger.h"
#include "verilog_parser.h"
#include <cstring>
namespace
eda
{
namespace
db_mgr
{
...
...
@@ -208,14 +210,16 @@ bool DbMgr::readBlockDef(const char* block_name,
return
true
;
}
bool
DbMgr
::
readVerilog
(
const
char
*
design_name
,
const
char
*
v_file
)
// bool DbMgr::readVerilog(const char* design_name,
// const char* v_file)
bool
DbMgr
::
readVerilog
(
const
std
::
string
&
design_name
,
const
std
::
string
&
v_file
)
{
if
(
design_name
!=
nullptr
)
{
if
(
haveBlockDB
(
design_name
))
{
setCurrentBlock
(
design_name
);
if
(
design_name
.
c_str
()
!=
nullptr
)
{
if
(
haveBlockDB
(
design_name
.
c_str
()
))
{
setCurrentBlock
(
design_name
.
c_str
()
);
}
else
{
setCurrentBlock
(
createBlockDB
(
design_name
));
setCurrentBlock
(
createBlockDB
(
design_name
.
c_str
()
));
}
}
else
{
if
(
current_block_db_
==
nullptr
)
{
...
...
@@ -224,7 +228,8 @@ bool DbMgr::readVerilog(const char* design_name,
}
}
verilog_parser_
->
setOdb
(
current_block_db_
);
return
verilog_parser_
->
read
(
design_name
,
v_file
);
return
true
;
// return verilog_parser_->read(design_name, v_file);
}
}
// namespace db_mgr
...
...
src/db_mgr/src/db_mgr.i
View file @
53ca0b2d
...
...
@@ -36,10 +36,12 @@ bool delete_blk_db(const char* block_name)
return getDbMgr()->deleteBlockDB(block_name);
}
bool read_verilog(const char* design, const char* v_file)
/*
bool read_verilog(const std::string& design, const std::string& v_file)
{
return getDbMgr()->readVerilog(design, v_file);
}
*/
} // namespace db_mgr
...
...
src/db_mgr/src/db_mgr.tcl
View file @
53ca0b2d
...
...
@@ -61,5 +61,5 @@ proc read_verilog { args } {
set design
$keys
(
-design
)
}
set filename
[
file
nativename
[
lindex
$args
0
]]
db_mgr::read_verilog
$design
$filename
#
db_mgr::read_verilog
$design
$filename
}
src/db_mgr/src/parsers/verilog_parser/CMakeLists.txt
View file @
53ca0b2d
...
...
@@ -2,14 +2,16 @@ add_library(db_mgr_verilog_parser)
target_sources
(
db_mgr_verilog_parser
PRIVATE
./verilog_database.cpp
./verilog_parser.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/verilog_database.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/verilog_parser.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_bison.cpp
)
target_include_directories
(
db_mgr_verilog_parser
PUBLIC
./
${
LIMBO_HOME
}
/limbo/parsers/verilog/bison
.
PRIVATE
${
LIMBO_HOME
}
)
target_link_libraries
(
db_mgr_verilog_parser
...
...
@@ -19,3 +21,8 @@ target_link_libraries(db_mgr_verilog_parser
verilogparser
# built in thirdparty Limbo
Boost::boost
)
target_compile_options
(
db_mgr_verilog_parser
PRIVATE
-D_GLIBCXX_USE_CXX11_ABI=0
# to avoid the std::string bug
)
src/db_mgr/src/parsers/verilog_parser/verilog_database.cpp
View file @
53ca0b2d
...
...
@@ -100,6 +100,7 @@ void VDb::verilog_pin_declare_cbk(
break
;
}
const
char
*
pin_name
=
pinName
.
c_str
();
/*
if (range.low == range.high) {
if (!odb::dbLogicPort::create(current_block_, pin_name, direction)) {
logger_->warn(utl::MGR, 202, "Failed to create logic pin: {}", pin_name);
...
...
@@ -113,6 +114,7 @@ void VDb::verilog_pin_declare_cbk(
}
}
}
*/
}
void
VDb
::
verilog_instance_cbk
(
...
...
src/db_mgr/src/parsers/verilog_parser/verilog_database.h
View file @
53ca0b2d
#include "VerilogDriver.h"
#include "
limbo/parsers/verilog/bison/
VerilogDriver.h"
#include <string>
namespace
odb
{
...
...
src/db_mgr/src/parsers/verilog_parser/verilog_parser.cpp
View file @
53ca0b2d
#include "verilog_parser.h"
#include "verilog_database.h"
// #include "VerilogDriver.h"
#include "utl/Logger.h"
#include "db.h"
#define _GLIBCXX_USE_CXX11_ABI 0
namespace
eda
{
namespace
db_mgr
{
...
...
@@ -43,7 +44,9 @@ bool VParser::read(std::string const& design_name,
v_db
.
setLogger
(
logger_
);
v_db
.
setOdb
(
odb_
);
// return true;
return
VerilogParser
::
read
(
v_db
,
v_file
);
const
std
::
string
tmp_str
=
"tmp"
;
// return VerilogParser::read(v_db, v_file);
return
VerilogParser
::
read
(
v_db
,
tmp_str
);
}
VParser
::~
VParser
()
...
...
src/db_mgr/src/parsers/verilog_parser/verilog_parser.h
View file @
53ca0b2d
#ifndef _VERILOG_PARSER_H_
#define _VERILOG_PARSER_H_
#include "VerilogDriver.h"
#include "
limbo/parsers/verilog/bison/
VerilogDriver.h"
#include <string>
#include <memory>
...
...
@@ -17,6 +17,8 @@ class Logger;
namespace
eda
{
namespace
db_mgr
{
using
VerilogParser
::
read
;
class
VDb
;
class
VParser
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment