3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-17 11:26:18 +00:00

ConstParser instead of const2ast using global state

This commit is contained in:
Emil J. Tywoniak 2025-05-26 17:16:24 +02:00
parent 24cd4aadd1
commit 33376da034
5 changed files with 77 additions and 31 deletions

View file

@ -35,6 +35,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include <optional>
// For std::gcd in C++17
// #include <numeric>
@ -4477,7 +4478,8 @@ std::unique_ptr<AstNode> AstNode::readmem(bool is_readmemh, std::string mem_file
continue;
}
auto value = VERILOG_FRONTEND::const2ast(stringf("%d'%c", mem_width, is_readmemh ? 'h' : 'b') + token);
VERILOG_FRONTEND::ConstParser p{mem_filename, std::nullopt};
auto value = p.const2ast(stringf("%d'%c", mem_width, is_readmemh ? 'h' : 'b') + token);
if (unconditional_init)
{