yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
setunset_t Struct Reference
+ Collaboration diagram for setunset_t:

Public Member Functions

 setunset_t (std::string unset_name)
 
 setunset_t (std::string set_name, std::vector< std::string > args, size_t &argidx)
 

Data Fields

RTLIL::IdString name
 
RTLIL::Const value
 
bool unset
 

Detailed Description

Definition at line 27 of file setattr.cc.

Constructor & Destructor Documentation

setunset_t::setunset_t ( std::string  unset_name)
inline

Definition at line 33 of file setattr.cc.

33 : name(RTLIL::escape_id(unset_name)), value(), unset(true) { }
static std::string escape_id(std::string str)
Definition: rtlil.h:251
bool unset
Definition: setattr.cc:31
RTLIL::IdString name
Definition: setattr.cc:29
RTLIL::Const value
Definition: setattr.cc:30
setunset_t::setunset_t ( std::string  set_name,
std::vector< std::string >  args,
size_t &  argidx 
)
inline

Definition at line 35 of file setattr.cc.

35  : name(RTLIL::escape_id(set_name)), value(), unset(false)
36  {
37  if (!args[argidx].empty() && args[argidx][0] == '"') {
38  std::string str = args[argidx++].substr(1);
39  while (str.size() != 0 && str[str.size()-1] != '"' && argidx < args.size())
40  str += args[argidx++];
41  if (str.size() != 0 && str[str.size()-1] == '"')
42  str = str.substr(0, str.size()-1);
43  value = RTLIL::Const(str);
44  } else {
45  RTLIL::SigSpec sig_value;
46  if (!RTLIL::SigSpec::parse(sig_value, NULL, args[argidx++]))
47  log_cmd_error("Can't decode value '%s'!\n", args[argidx-1].c_str());
48  value = sig_value.as_const();
49  }
50  }
RTLIL::Const as_const() const
Definition: rtlil.cc:2857
static std::string escape_id(std::string str)
Definition: rtlil.h:251
void log_cmd_error(const char *format,...)
Definition: log.cc:211
bool unset
Definition: setattr.cc:31
#define NULL
RTLIL::IdString name
Definition: setattr.cc:29
RTLIL::Const value
Definition: setattr.cc:30
static bool parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str)
Definition: rtlil.cc:2972

+ Here is the call graph for this function:

Field Documentation

RTLIL::IdString setunset_t::name

Definition at line 29 of file setattr.cc.

bool setunset_t::unset

Definition at line 31 of file setattr.cc.

RTLIL::Const setunset_t::value

Definition at line 30 of file setattr.cc.


The documentation for this struct was generated from the following file: