64 auto*
mod = GetPointer<module>(cir);
67 THROW_ASSERT(np,
"NP Behavioral description is missing for module: " +
70 THROW_ASSERT(beh_desc !=
"",
"SYSTEM VERILOG behavioral description is missing for module: " +
73 if(!
parameters->getOption<
bool>(OPT_reset_level))
75 boost::replace_all(beh_desc,
"1RESET_EDGE_FORCE",
"or negedge " + std::string(
RESET_PORT_NAME));
76 if(
parameters->getOption<std::string>(OPT_reset_type) ==
"async")
78 boost::replace_all(beh_desc,
"1RESET_EDGE",
"or negedge " + std::string(
RESET_PORT_NAME));
82 boost::replace_all(beh_desc,
"1RESET_EDGE",
"");
84 boost::replace_all(beh_desc,
"1RESET_VALUE", std::string(
RESET_PORT_NAME) +
" == 1'b0");
88 boost::replace_all(beh_desc,
"1RESET_EDGE_FORCE",
"or posedge " + std::string(
RESET_PORT_NAME));
89 if(
parameters->getOption<std::string>(OPT_reset_type) ==
"async")
91 boost::replace_all(beh_desc,
"1RESET_EDGE",
"or posedge " + std::string(
RESET_PORT_NAME));
95 boost::replace_all(beh_desc,
"1RESET_EDGE",
"");
97 boost::replace_all(beh_desc,
"1RESET_VALUE", std::string(
RESET_PORT_NAME) +
" == 1'b1");
99 if(
parameters->getOption<
bool>(OPT_reg_init_value))
101 boost::replace_all(beh_desc,
"1INIT_ZERO_VALUE",
"=0");
105 boost::replace_all(beh_desc,
"1INIT_ZERO_VALUE",
"");
static std::string convert_to_identifier(const language_writer *writer, const std::string &id)
Converts a generic string to a language compliant identifier.
File containing functions and utilities to support the printing of debug messagges.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
int debug_level
debugging level of the class
std::string get_NP_functionality(NP_functionaly_type type) const
Return the description provided the type.
exceptions managed by PandA
Class to print indented code.
const IndentedOutputStreamRef indented_output_stream
Represents the stream we are currently writing to.
Class specification of the manager of the technology library data structures.
#define GET_TYPE_NAME(structural_obj)
Macro returning the string name of a type.
Auxiliary methods for manipulating string.
void Append(const std::string &str)
Append a string to the output.
~system_verilog_writer() override
Destructor.
This class describes all classes used to represent a structural object.
const ParameterConstRef parameters
the set of input parameters
system_verilog_writer(const ParameterConstRef parameters)
Constructor.
this class is used to manage the command-line or XML options.
Not parsed functionality manager.
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
void write_NP_functionalities(const structural_objectRef &cir) override
Write in the proper language the behavioral description of the module described in "Not Parsed" form...
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...