From: Clifford Wolf Date: Mon, 3 Mar 2014 01:13:17 +0000 (+0100) Subject: ezSAT: Added frozen_literal() API X-Git-Tag: yosys-0.3.0~96 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d5bd93997c9ce7c31ef430684700a2096618672e;p=yosys.git ezSAT: Added frozen_literal() API --- diff --git a/libs/ezsat/ezsat.cc b/libs/ezsat/ezsat.cc index bbebee74f..fb3d24996 100644 --- a/libs/ezsat/ezsat.cc +++ b/libs/ezsat/ezsat.cc @@ -67,6 +67,20 @@ int ezSAT::literal(const std::string &name) return literalsCache.at(name); } +int ezSAT::frozen_literal() +{ + int id = literal(); + freeze(id); + return id; +} + +int ezSAT::frozen_literal(const std::string &name) +{ + int id = literal(name); + freeze(id); + return id; +} + int ezSAT::expression(OpId op, int a, int b, int c, int d, int e, int f) { std::vector args(6); diff --git a/libs/ezsat/ezsat.h b/libs/ezsat/ezsat.h index 13b39d4ef..b0b731d0a 100644 --- a/libs/ezsat/ezsat.h +++ b/libs/ezsat/ezsat.h @@ -79,6 +79,8 @@ public: int value(bool val); int literal(); int literal(const std::string &name); + int frozen_literal(); + int frozen_literal(const std::string &name); int expression(OpId op, int a = 0, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0); int expression(OpId op, const std::vector &args);