44 #ifndef VERILOG_WRITER_HPP 45 #define VERILOG_WRITER_HPP 84 void write_comment(
const std::string& comment_string)
override;
148 bool write_parametrization)
override;
161 bool first_port_analyzed)
override;
198 const std::string& reset_port,
const std::string& reset_state,
bool one_hot)
override;
207 const std::string& reset_port,
const std::string& clock_port,
208 const std::string& reset_type,
bool connect_present_next_state_signals)
override;
220 bool single_proc,
unsigned int output_index,
const structural_objectRef& cir,
const std::string& reset_state,
221 const std::string& reset_port,
const std::string& start_port,
const std::string& clock_port,
222 std::vector<std::string>::const_iterator& first, std::vector<std::string>::const_iterator& end,
bool is_yosys,
223 const std::map<
unsigned int,
std::map<std::string, std::set<unsigned int>>>& bypass_signals)
override;
256 void write_assign(
const std::string& op0,
const std::string& op1)
override;
271 void WriteBuiltin(
const structural_objectConstRef component)
override;
void write_port_decl_header() override
Write the header for port_decl.
void write_port_binding(const structural_objectRef &port, const structural_objectRef &object_bounded, bool first_port_analyzed) override
Write the binding of a port.
void write_signal_declaration(const structural_objectRef &cir) override
Write the declaration of a signal.
void write_assign(const std::string &op0, const std::string &op1) override
void WriteBuiltin(const structural_objectConstRef component) override
Write a builtin component.
std::string type_converter(structural_type_descriptorRef Type) override
Return a language based type string given a structural_type_descriptor.
void write_io_signal_post_fix_vector(const structural_objectRef &port, const structural_objectRef &sig) override
void write_vector_port_binding(const structural_objectRef &port, bool first_port_analyzed) override
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
void write_module_internal_declaration(const structural_objectRef &cir) override
Write the declaration of internal objects of the module.
bool check_keyword(const std::string &id) const override
std::string get_name() const override
Return the name of the language writer.
verilog_writer(const ParameterConstRef parameters)
Constructor.
void write_comment(const std::string &comment_string) override
Print a comment.
void write_header() override
Writes the header part of the file.
void write_module_parametrization(const structural_objectRef &cir) override
Module can be parameterized with respect different features.
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.
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...
unsigned map[NUM_VERTICES]
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
void write_module_definition_begin(const structural_objectRef &cir) override
Write the top constructor declaration.
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.
void write_module_instance_end(const structural_objectRef &cir) override
Write the ending part of the instance of a module.
void write_io_signal_post_fix(const structural_objectRef &port, const structural_objectRef &sig) override
Write some code managing primary ports to signals connections.
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.
void write_module_definition_end(const structural_objectRef &cir) override
Write the end part in a module declaration.
void write_module_parametrization_decl(const structural_objectRef &cir) override
Write the declaration of the module parameters.
void write_port_decl_tail() override
Write the tail for port_decl.
std::string get_extension() const override
Return the filename extension associated with the verilog_writer.
bool has_output_prefix() const override
void write_component_declaration(const structural_objectRef &cir) override
Write the declaration of a component.
void write_module_declaration(const structural_objectRef &cir) override
Write the declaration of the module.
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.
~verilog_writer() override
Destructor.
void write_library_declaration(const structural_objectRef &cir) override
Write the #include for each used library.
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...
const ParameterConstRef parameters
the set of input parameters
static bool check_keyword_verilog(const std::string &word)
HDL writer base class used to specify the interface of the different language writers.
std::string may_slice_string(const structural_objectRef &cir)
return the slice in case of a port owned by a port vector
static const std::set< std::string > keywords
void write_port_declaration(const structural_objectRef &cir, bool last_port_to_analyze) override
Write the port declaration starting from a port object.