mirror of
https://github.com/YosysHQ/yosys
synced 2026-05-05 01:45:17 +00:00
Merge pull request #4928 from XutaxKamay/main
Add gatesi_mode to init gates under gates_mode in BLIF format
This commit is contained in:
commit
5b10c7f3c6
7 changed files with 1018 additions and 8 deletions
|
|
@ -470,6 +470,27 @@ void parse_blif(RTLIL::Design *design, std::istream &f, IdString dff_name, bool
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, ".gateinit"))
|
||||
{
|
||||
char *p = strtok(NULL, " \t\r\n");
|
||||
if (p == NULL)
|
||||
goto error;
|
||||
|
||||
char *n = strtok(p, "=");
|
||||
char *init = strtok(NULL, "=");
|
||||
if (n == NULL || init == NULL)
|
||||
goto error;
|
||||
if (init[0] != '0' && init[0] != '1')
|
||||
goto error;
|
||||
|
||||
if (blif_wire(n)->attributes.find(ID::init) == blif_wire(n)->attributes.end())
|
||||
blif_wire(n)->attributes.emplace(ID::init, Const(init[0] == '1' ? 1 : 0, 1));
|
||||
else
|
||||
blif_wire(n)->attributes[ID::init] = Const(init[0] == '1' ? 1 : 0, 1);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strcmp(cmd, ".names"))
|
||||
{
|
||||
char *p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue