mirror of https://github.com/YosysHQ/yosys.git
kernel: rtlil: replaced the width limit exceptions with `log_error`
This commit is contained in:
parent
2b9982101a
commit
42e4610e3a
|
@ -202,7 +202,7 @@ const pool<IdString> &RTLIL::builtin_ff_cell_types() {
|
||||||
RTLIL::Const::Const(const std::string &str)
|
RTLIL::Const::Const(const std::string &str)
|
||||||
{
|
{
|
||||||
if (str.size() * 8 > 0x1000000)
|
if (str.size() * 8 > 0x1000000)
|
||||||
throw std::length_error("RTLIL Const width must be less than 2^24");
|
log_error("RTLIL Const width must be less than 2^24");
|
||||||
|
|
||||||
flags = RTLIL::CONST_FLAG_STRING;
|
flags = RTLIL::CONST_FLAG_STRING;
|
||||||
bits.reserve(str.size() * 8);
|
bits.reserve(str.size() * 8);
|
||||||
|
@ -218,10 +218,10 @@ RTLIL::Const::Const(const std::string &str)
|
||||||
RTLIL::Const::Const(int val, int width)
|
RTLIL::Const::Const(int val, int width)
|
||||||
{
|
{
|
||||||
if (width < 0)
|
if (width < 0)
|
||||||
throw std::length_error("RTLIL Const width must not be negative");
|
log_error("RTLIL Const width must not be negative");
|
||||||
|
|
||||||
if (width > 0x1000000)
|
if (width > 0x1000000)
|
||||||
throw std::length_error("RTLIL Const width must be less than 2^24");
|
log_error("RTLIL Const width must be less than 2^24");
|
||||||
|
|
||||||
flags = RTLIL::CONST_FLAG_NONE;
|
flags = RTLIL::CONST_FLAG_NONE;
|
||||||
bits.reserve(width);
|
bits.reserve(width);
|
||||||
|
@ -234,10 +234,10 @@ RTLIL::Const::Const(int val, int width)
|
||||||
RTLIL::Const::Const(RTLIL::State bit, int width)
|
RTLIL::Const::Const(RTLIL::State bit, int width)
|
||||||
{
|
{
|
||||||
if (width < 0)
|
if (width < 0)
|
||||||
throw std::length_error("RTLIL Const width must not be negative");
|
log_error("RTLIL Const width must not be negative");
|
||||||
|
|
||||||
if (width > 0x1000000)
|
if (width > 0x1000000)
|
||||||
throw std::length_error("RTLIL Const width must be less than 2^24");
|
log_error("RTLIL Const width must be less than 2^24");
|
||||||
|
|
||||||
flags = RTLIL::CONST_FLAG_NONE;
|
flags = RTLIL::CONST_FLAG_NONE;
|
||||||
bits.reserve(width);
|
bits.reserve(width);
|
||||||
|
@ -249,7 +249,7 @@ RTLIL::Const::Const(const std::vector<bool> &bits)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (bits.size() > 0x1000000)
|
if (bits.size() > 0x1000000)
|
||||||
throw std::length_error("RTLIL Const width must be less than 2^24");
|
log_error("RTLIL Const width must be less than 2^24");
|
||||||
|
|
||||||
flags = RTLIL::CONST_FLAG_NONE;
|
flags = RTLIL::CONST_FLAG_NONE;
|
||||||
this->bits.reserve(bits.size());
|
this->bits.reserve(bits.size());
|
||||||
|
@ -317,7 +317,7 @@ RTLIL::Const RTLIL::Const::from_string(const std::string &str)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (str.size() > 0x1000000)
|
if (str.size() > 0x1000000)
|
||||||
throw std::length_error("RTLIL width must be less than 2^24");
|
log_error("RTLIL width must be less than 2^24");
|
||||||
|
|
||||||
Const c;
|
Const c;
|
||||||
c.bits.reserve(str.size());
|
c.bits.reserve(str.size());
|
||||||
|
|
Loading…
Reference in New Issue