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
705cc2ad
Commit
705cc2ad
authored
Dec 04, 2022
by
lvzhengyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add readDef
parent
2380229d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
3 deletions
+93
-3
README.md
+11
-0
src/db_mgr/include/db_mgr/db_mgr.h
+5
-3
src/db_mgr/src/db_mgr.cpp
+77
-0
No files found.
README.md
View file @
705cc2ad
...
@@ -3,6 +3,17 @@
...
@@ -3,6 +3,17 @@
*
I install tcltk in my path. Run shell command first
`source setup.sh`
*
I install tcltk in my path. Run shell command first
`source setup.sh`
*
To run minieda, enter ./install, and
`./bin/minieda`
*
To run minieda, enter ./install, and
`./bin/minieda`
## ROAD MAP
*
**Finnal Goal :**
design pin positions for abutting design style
*
design db style
*
(
**This**
) each block per db
*
a db contains multiple block, with each block in a dbChip
*
a db supports containing multiple chips
*
create a new data structure for pin assignment task
## TODO
## TODO
*
add DB Manager
*
add DB Manager
...
...
src/db_mgr/include/db_mgr/db_mgr.h
View file @
705cc2ad
...
@@ -55,9 +55,11 @@ public:
...
@@ -55,9 +55,11 @@ public:
bool
haveBlockDB
(
const
std
::
string
block
);
bool
haveBlockDB
(
const
std
::
string
block
);
bool
createBlockDB
(
const
char
*
block_name
);
bool
createBlockDB
(
const
char
*
block_name
);
bool
deleteBlockDB
(
const
char
*
block_name
);
bool
deleteBlockDB
(
const
char
*
block_name
);
/*
bool
readBlockDef
(
const
char
*
block_name
,
bool readBlockDef();
const
char
*
def_file
,
*/
bool
cont_on_err
,
bool
is_floorplan
,
bool
is_incr
);
// incr: incremental
void
setLogger
(
utl
::
Logger
*
logger
);
void
setLogger
(
utl
::
Logger
*
logger
);
void
init
(
utl
::
Logger
*
logger
);
void
init
(
utl
::
Logger
*
logger
);
...
...
src/db_mgr/src/db_mgr.cpp
View file @
705cc2ad
...
@@ -93,5 +93,82 @@ bool DbMgr::deleteBlockDB(const char* block_name)
...
@@ -93,5 +93,82 @@ bool DbMgr::deleteBlockDB(const char* block_name)
return
true
;
return
true
;
}
}
bool
DbMgr
::
readBlockDef
(
const
char
*
block_name
,
const
char
*
def_file
,
bool
cont_on_err
,
bool
is_floorplan
,
bool
is_incr
)
{
// Before read def, ensure the corresponding block has been created.
// Read netlist before read def?
/* ** About the Def Reader **
odb::defin simply wraps odb::definReader.
odb::definReader::createBlock() calls LefDefParser::defrRead()
LefDefParser::defrRead()
- the main reader function.
- defined in odb/src/def/def/defrReader.cpp.
- calls Bison Parser entry: defyyparse(), to do the detailed parse job.
- parser rules is defined in odb/src/defin/def.y, and Bison read this to create parser.
def parsing process is monitored by LefDefParser::defContext, whose prototype is LefDefParser::defrContext.
class LefDefParser::defrContext
- defined in odb/src/def/def/defrData.hpp.
LefDefParser::defContext
- instantiate in odb/src/def/def/defrData.hpp.
- initialized in odb/src/def/def/defrReader.cpp
- content of def file is parsed and stored by corresponding callback function of syntaxes.
definReader::designCallback
- if reader_->parent_ (odb::dbBlock* ) exists, create a new child dbBlock of reader_->parent_
- else: create block under reader_->_db->getChip();
- if DEFAULT mode, create a new block
- else: read to an existing block
- different modes corresponds to different callbacks.
odb::dbBlock::create
- 1. create top block for a chip.
- 2. create a hierarchical/child block for a block.
*/
if
(
!
haveBlockDB
(
block_name
))
{
logger_
->
error
(
utl
::
MGR
,
5
,
"Failed to read DEF {} for block {}"
,
def_file
,
block_name
);
return
false
;
}
if
(
is_floorplan
&&
is_incr
)
{
logger_
->
error
(
utl
::
MGR
,
6
,
"Cannot set floorplan and incremental mode at the same time"
);
return
false
;
}
odb
::
defin
::
MODE
mode
=
odb
::
defin
::
DEFAULT
;
if
(
is_floorplan
)
{
mode
=
odb
::
defin
::
FLOORPLAN
;
}
else
if
(
is_incr
)
{
mode
=
odb
::
defin
::
INCREMENTAL
;
}
odb
::
dbDatabase
*
block_db
=
block_dbs_
.
find
(
block_name
)
->
second
;
// to ensure `delete` can work, use `new` here
def_parser_
=
std
::
move
(
std
::
unique_ptr
<
odb
::
defin
>
(
new
odb
::
defin
(
block_db
,
logger_
,
mode
)));
if
(
cont_on_err
)
{
def_parser_
->
continueOnErrors
();
}
std
::
vector
<
odb
::
dbLib
*>
search_libs
;
for
(
auto
lib
:
block_db
->
getLibs
())
{
search_libs
.
push_back
(
lib
);
}
// temprary test
if
(
block_db
->
getChip
()
==
nullptr
)
{
odb
::
dbChip
*
chip
=
def_parser_
->
createChip
(
search_libs
,
def_file
);
}
else
{
odb
::
dbBlock
*
block
=
def_parser_
->
createBlock
(
block_db
->
getChip
()
->
getBlock
(),
search_libs
,
def_file
);
}
delete
def_parser_
.
release
();
// def_parser_ becomes an empty ptr now.
return
true
;
}
}
// namespace db_mgr
}
// namespace db_mgr
}
// namespace eda
}
// namespace eda
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