3
0
Fork 0
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:
Emil J 2026-01-26 23:30:11 +01:00 committed by GitHub
commit 5b10c7f3c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 1018 additions and 8 deletions

View file

@ -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;