PandA-2024.02
|
#include <sv_writer.hpp>
Public Member Functions | |
std::string | get_name () const override |
Return the name of the language writer. More... | |
std::string | get_extension () const override |
Return the filename extension associted with the verilog_writer. More... | |
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. More... | |
system_verilog_writer (const ParameterConstRef parameters) | |
Constructor. More... | |
~system_verilog_writer () override | |
Destructor. More... | |
Public Member Functions inherited from verilog_writer | |
std::string | get_name () const override |
Return the name of the language writer. More... | |
std::string | get_extension () const override |
Return the filename extension associated with the verilog_writer. More... | |
void | write_comment (const std::string &comment_string) override |
Print a comment. More... | |
std::string | type_converter (structural_type_descriptorRef Type) override |
Return a language based type string given a structural_type_descriptor. More... | |
std::string | type_converter_size (const structural_objectRef &cir) override |
Return a language based type string given a structural_type_descriptor for the range of the array. More... | |
std::string | may_slice_string (const structural_objectRef &cir) |
return the slice in case of a port owned by a port vector More... | |
void | write_library_declaration (const structural_objectRef &cir) override |
Write the #include for each used library. More... | |
void | write_module_declaration (const structural_objectRef &cir) override |
Write the declaration of the module. More... | |
void | write_module_internal_declaration (const structural_objectRef &cir) override |
Write the declaration of internal objects of the module. More... | |
void | write_port_declaration (const structural_objectRef &cir, bool last_port_to_analyze) override |
Write the port declaration starting from a port object. More... | |
void | write_component_declaration (const structural_objectRef &cir) override |
Write the declaration of a component. More... | |
void | write_signal_declaration (const structural_objectRef &cir) override |
Write the declaration of a signal. More... | |
void | write_module_definition_begin (const structural_objectRef &cir) override |
Write the top constructor declaration. More... | |
void | write_module_instance_begin (const structural_objectRef &cir, const std::string &module_name, bool write_parametrization) override |
Write the initial part of the instance of a module. More... | |
void | write_module_instance_end (const structural_objectRef &cir) override |
Write the ending part of the instance of a module. More... | |
void | write_port_binding (const structural_objectRef &port, const structural_objectRef &object_bounded, bool first_port_analyzed) override |
Write the binding of a port. More... | |
void | write_vector_port_binding (const structural_objectRef &port, bool first_port_analyzed) override |
void | write_module_definition_end (const structural_objectRef &cir) override |
Write the end part in a module declaration. More... | |
void | write_io_signal_post_fix (const structural_objectRef &port, const structural_objectRef &sig) override |
Write some code managing primary ports to signals connections. More... | |
void | write_io_signal_post_fix_vector (const structural_objectRef &port, const structural_objectRef &sig) override |
void | write_module_parametrization (const structural_objectRef &cir) override |
Module can be parameterized with respect different features. More... | |
void | write_state_declaration (const structural_objectRef &cir, const std::list< std::string > &list_of_states, const std::string &reset_port, const std::string &reset_state, bool one_hot) override |
write the declaration of all the states of the finite state machine. More... | |
void | write_present_state_update (const structural_objectRef cir, const std::string &reset_state, const std::string &reset_port, const std::string &clock_port, const std::string &reset_type, bool connect_present_next_state_signals) override |
write the present_state update process More... | |
void | write_transition_output_functions (bool single_proc, unsigned int output_index, const structural_objectRef &cir, const std::string &reset_state, const std::string &reset_port, const std::string &start_port, const std::string &clock_port, std::vector< std::string >::const_iterator &first, std::vector< std::string >::const_iterator &end, bool is_yosys, const std::map< unsigned int, std::map< std::string, std::set< unsigned int >>> &bypass_signals) override |
Write the transition and output functions. More... | |
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. More... | |
void | write_port_decl_header () override |
Write the header for port_decl. More... | |
void | write_port_decl_tail () override |
Write the tail for port_decl. More... | |
void | write_module_parametrization_decl (const structural_objectRef &cir) override |
Write the declaration of the module parameters. More... | |
verilog_writer (const ParameterConstRef parameters) | |
Constructor. More... | |
~verilog_writer () override | |
Destructor. More... | |
void | write_assign (const std::string &op0, const std::string &op1) override |
bool | has_output_prefix () const override |
bool | check_keyword (const std::string &id) const override |
void | write_header () override |
Writes the header part of the file. More... | |
void | WriteBuiltin (const structural_objectConstRef component) override |
Write a builtin component. More... | |
Public Member Functions inherited from language_writer | |
language_writer (char open_char, char close_char, const ParameterConstRef parameters) | |
Constructor. More... | |
virtual | ~language_writer () |
Destructor. More... | |
virtual void | write (const std::string &rawString) |
Writes a raw string into the stream. More... | |
const std::string | WriteString () const |
Dump the content of the write as a string. More... | |
void | WriteFile (const std::string &filename) const |
Write content to a file. More... | |
CustomSet< std::string > | GetHDLReservedNames () const |
Return the names of auxiliary signals which will be used by backend. More... | |
void | WriteLicense () |
Write the license. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from verilog_writer | |
static bool | check_keyword_verilog (const std::string &word) |
Static Public Member Functions inherited from language_writer | |
static language_writerRef | create_writer (HDLWriter_Language language, const technology_managerConstRef TM, const ParameterConstRef parameters) |
Creates the specialization of the writer based on the desired language. More... | |
static unsigned int | bitnumber (unsigned long long n) |
Counts the number of bits in an unsigned int. More... | |
Protected Member Functions inherited from language_writer | |
std::string | encode_one_hot (unsigned int n_states, unsigned int val) const |
Protected Attributes inherited from language_writer | |
const IndentedOutputStreamRef | indented_output_stream |
Represents the stream we are currently writing to. More... | |
CustomOrderedSet< std::string > | list_of_lib |
list of library imported (e.g., includes). More... | |
CustomOrderedSet< std::string > | list_of_customized_gates |
list of customized gates More... | |
const ParameterConstRef | parameters |
the set of input parameters More... | |
int | debug_level |
debugging level of the class More... | |
Static Protected Attributes inherited from verilog_writer | |
static const std::map< std::string, std::string > | builtin_to_verilog_keyword |
map putting into relation standard gates with the corresponding built-in Verilog statements. More... | |
static const std::set< std::string > | keywords |
Definition at line 48 of file sv_writer.hpp.
|
explicit |
Constructor.
Definition at line 110 of file sv_writer.cpp.
References language_writer::debug_level, GET_CLASS, language_writer::parameters, and ~system_verilog_writer().
Referenced by get_extension().
|
overridedefault |
Destructor.
Referenced by get_extension(), and system_verilog_writer().
|
inlineoverridevirtual |
Return the filename extension associted with the verilog_writer.
Implements language_writer.
Definition at line 61 of file sv_writer.hpp.
References language_writer::parameters, system_verilog_writer(), write_NP_functionalities(), and ~system_verilog_writer().
|
inlineoverridevirtual |
Return the name of the language writer.
Implements language_writer.
Definition at line 54 of file sv_writer.hpp.
|
overridevirtual |
Write in the proper language the behavioral description of the module described in "Not Parsed" form.
. include
cir | is the component. |
Utility include
manage reset by preprocessing the behavioral description
Implements language_writer.
Definition at line 62 of file sv_writer.cpp.
References IndentedOutputStream::Append(), HDL_manager::convert_to_identifier(), NP_functionality::get_NP_functionality(), GET_TYPE_NAME, language_writer::indented_output_stream, lenet_tvm::mod, language_writer::parameters, RESET_PORT_NAME, NP_functionality::SYSTEM_VERILOG_PROVIDED, and THROW_ASSERT.
Referenced by get_extension().