PandA-2024.02
|
#include <VHDL_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 associated with the VHDL_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 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 parametrized 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, 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_assign (const std::string &op0, const std::string &op1) override |
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... | |
VHDL_writer (const technology_managerConstRef TM, const ParameterConstRef parameters) | |
Constructor. More... | |
~VHDL_writer () override | |
Destructor. More... | |
bool | has_output_prefix () const override |
bool | check_keyword (const std::string &) const override |
void | WriteBuiltin (const structural_objectConstRef component) override |
Write a builtin component. More... | |
void | write_header () override |
Write the header of vhdl file. 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... | |
Static Public Member Functions | |
static bool | check_keyword_vhdl (const std::string &id) |
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 Attributes | |
CustomOrderedSet< std::string > | list_of_comp_already_def |
const technology_managerConstRef | TM |
The technology manager. More... | |
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 | |
static const std::set< std::string > | keywords |
Additional Inherited Members | |
Protected Member Functions inherited from language_writer | |
std::string | encode_one_hot (unsigned int n_states, unsigned int val) const |
Definition at line 54 of file VHDL_writer.hpp.
VHDL_writer::VHDL_writer | ( | const technology_managerConstRef | TM, |
const ParameterConstRef | parameters | ||
) |
Constructor.
TM | is the technology manager |
parameters | is the set of input parameters |
Definition at line 81 of file VHDL_writer.cpp.
References language_writer::debug_level, GET_CLASS, language_writer::parameters, and ~VHDL_writer().
Referenced by get_extension().
|
overridedefault |
Destructor.
Referenced by get_extension(), and VHDL_writer().
|
overridevirtual |
Implements language_writer.
Definition at line 2161 of file VHDL_writer.cpp.
References check_keyword_vhdl().
Referenced by has_output_prefix().
|
static |
Definition at line 2166 of file VHDL_writer.cpp.
References keywords.
Referenced by check_keyword().
|
inlineoverridevirtual |
Return the filename extension associated with the VHDL_writer.
Implements language_writer.
Definition at line 77 of file VHDL_writer.hpp.
References map, may_slice_string(), language_writer::parameters, type_converter(), type_converter_size(), VHDL_writer(), write_assign(), write_comment(), write_component_declaration(), write_io_signal_post_fix(), write_io_signal_post_fix_vector(), write_library_declaration(), write_module_declaration(), write_module_definition_begin(), write_module_definition_end(), write_module_instance_begin(), write_module_instance_end(), write_module_internal_declaration(), write_module_parametrization(), write_module_parametrization_decl(), write_NP_functionalities(), write_port_binding(), write_port_decl_header(), write_port_decl_tail(), write_port_declaration(), write_present_state_update(), write_signal_declaration(), write_state_declaration(), write_transition_output_functions(), write_vector_port_binding(), and ~VHDL_writer().
|
inlineoverridevirtual |
Return the name of the language writer.
Implements language_writer.
Definition at line 70 of file VHDL_writer.hpp.
|
inlineoverridevirtual |
Implements language_writer.
Definition at line 250 of file VHDL_writer.hpp.
References check_keyword(), write_header(), and WriteBuiltin().
std::string VHDL_writer::may_slice_string | ( | const structural_objectRef & | cir | ) |
return the slice in case of a port owned by a port vector
port | is the port |
Definition at line 319 of file VHDL_writer.cpp.
References BITSIZE_PREFIX, structural_type_descriptor::BOOL, structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), structural_object::get_typeRef(), structural_type_descriptor::INT, lenet_tvm::mod, NUM_ELEM_PREFIX, structural_type_descriptor::OTHER, port_vector_o_K, structural_type_descriptor::print(), structural_type_descriptor::REAL, structural_type_descriptor::size, THROW_ERROR, structural_type_descriptor::type, structural_type_descriptor::UINT, structural_type_descriptor::UNKNOWN, structural_type_descriptor::USER, structural_type_descriptor::VECTOR_BOOL, structural_type_descriptor::VECTOR_INT, structural_type_descriptor::VECTOR_REAL, structural_type_descriptor::vector_size, structural_type_descriptor::VECTOR_UINT, and structural_type_descriptor::VECTOR_USER.
Referenced by get_extension(), write_io_signal_post_fix(), and write_port_binding().
|
overridevirtual |
Return a language based type string given a structural_type_descriptor.
Type | is the structural_type_descriptor. |
Implements language_writer.
Definition at line 94 of file VHDL_writer.cpp.
References structural_type_descriptor::BOOL, structural_type_descriptor::id_type, structural_type_descriptor::INT, structural_type_descriptor::OTHER, structural_type_descriptor::REAL, THROW_ERROR, THROW_UNREACHABLE, structural_type_descriptor::type, structural_type_descriptor::UINT, structural_type_descriptor::UNKNOWN, structural_type_descriptor::USER, structural_type_descriptor::VECTOR_BOOL, structural_type_descriptor::VECTOR_INT, structural_type_descriptor::VECTOR_REAL, structural_type_descriptor::VECTOR_UINT, and structural_type_descriptor::VECTOR_USER.
Referenced by get_extension(), write_port_binding(), write_port_declaration(), and write_signal_declaration().
|
overridevirtual |
Return a language based type string given a structural_type_descriptor for the range of the array.
In case of scalar type it return an empty string.
cir | is the object for which the size has been computed. |
Implements language_writer.
Definition at line 145 of file VHDL_writer.cpp.
References BITSIZE_PREFIX, structural_type_descriptor::BOOL, HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), structural_object::get_path(), GET_TYPE_SIZE, structural_object::get_typeRef(), INDENT_DBG_MEX, structural_type_descriptor::INT, lenet_tvm::mod, NUM_ELEM_PREFIX, structural_type_descriptor::OTHER, port_vector_o_K, PORTSIZE_PREFIX, structural_type_descriptor::REAL, signal_vector_o_K, structural_type_descriptor::size, STR, THROW_ERROR, THROW_UNREACHABLE, structural_type_descriptor::UINT, structural_type_descriptor::UNKNOWN, structural_type_descriptor::USER, structural_type_descriptor::VECTOR_BOOL, structural_type_descriptor::VECTOR_INT, structural_type_descriptor::VECTOR_REAL, structural_type_descriptor::vector_size, structural_type_descriptor::VECTOR_UINT, and structural_type_descriptor::VECTOR_USER.
Referenced by get_extension(), write_port_declaration(), and write_signal_declaration().
|
overridevirtual |
Implements language_writer.
Definition at line 1982 of file VHDL_writer.cpp.
References THROW_ERROR.
Referenced by get_extension().
|
overridevirtual |
Print a comment.
comment_string | is the string to be printed as a comment. |
Implements language_writer.
Definition at line 89 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), and language_writer::indented_output_stream.
Referenced by get_extension(), write_component_declaration(), write_present_state_update(), write_state_declaration(), and write_transition_output_functions().
|
overridevirtual |
Write the declaration of a component.
cir | is the component to be declared. |
Implements language_writer.
Definition at line 544 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), IndentedOutputStream::Deindent(), structural_object::get_kind_text(), HDL_manager::get_mod_typename(), structural_object::get_path(), IndentedOutputStream::Indent(), language_writer::indented_output_stream, list_of_comp_already_def, lenet_tvm::mod, THROW_ASSERT, write_comment(), write_module_parametrization_decl(), and write_port_declaration().
Referenced by get_extension().
|
overridevirtual |
Write the header of vhdl file.
Reimplemented from language_writer.
Definition at line 2244 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), and language_writer::indented_output_stream.
Referenced by has_output_prefix().
|
overridevirtual |
Write some code managing primary ports to signals connections.
port | is the primary port for which this problem happens. |
sig | is the attached signal. |
Implements language_writer.
Definition at line 995 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), structural_type_descriptor::BOOL, constant_o_K, HDL_manager::convert_to_identifier(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), GET_TYPE_SIZE, language_writer::indented_output_stream, structural_type_descriptor::INT, may_slice_string(), port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, THROW_ASSERT, structural_type_descriptor::UINT, and structural_type_descriptor::VECTOR_BOOL.
Referenced by get_extension().
|
overridevirtual |
Implements language_writer.
Definition at line 1118 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), structural_type_descriptor::BOOL, HDL_manager::convert_to_identifier(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), language_writer::indented_output_stream, structural_type_descriptor::INT, port_vector_o_K, signal_vector_o_K, THROW_ASSERT, structural_type_descriptor::UINT, and structural_type_descriptor::VECTOR_BOOL.
Referenced by get_extension().
|
overridevirtual |
Write used library.
cir | is the component for which the library declarations are written. |
Implements language_writer.
Definition at line 456 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), channel_o_K, component_o_K, structural_object::get_kind(), language_writer::indented_output_stream, NP_functionality::IP_LIBRARY, and THROW_ASSERT.
Referenced by get_extension().
|
overridevirtual |
Write the declaration of the module.
cir | is the module to be written. |
Implements language_writer.
Definition at line 483 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), channel_o_K, component_o_K, HDL_manager::convert_to_identifier(), structural_object::get_kind(), GET_TYPE_NAME, language_writer::indented_output_stream, list_of_comp_already_def, and THROW_ASSERT.
Referenced by get_extension().
|
overridevirtual |
Write the top constructor declaration.
cir | is the top component to be declared. |
Implements language_writer.
Definition at line 656 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), IndentedOutputStream::Deindent(), IndentedOutputStream::Indent(), and language_writer::indented_output_stream.
Referenced by get_extension().
|
overridevirtual |
Write the end part in a module declaration.
cir | is the top component to be declared. |
Implements language_writer.
Definition at line 684 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), channel_o_K, component_o_K, HDL_manager::convert_to_identifier(), IndentedOutputStream::Deindent(), structural_object::get_kind(), GET_TYPE_NAME, language_writer::indented_output_stream, and THROW_ASSERT.
Referenced by get_extension().
|
overridevirtual |
Write the initial part of the instance of a module.
module_name | is the name of the module to be instanced. It has to be specified since VHDL and verilog can print in different ways |
cir | is the module to be instanced. |
Implements language_writer.
Definition at line 663 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), channel_o_K, component_o_K, HDL_manager::convert_to_identifier(), structural_object::get_id(), structural_object::get_kind(), IndentedOutputStream::Indent(), language_writer::indented_output_stream, THROW_ASSERT, and write_module_parametrization().
Referenced by get_extension().
|
overridevirtual |
Write the ending part of the instance of a module.
cir | is the module to be instanced. |
Implements language_writer.
Definition at line 678 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), IndentedOutputStream::Deindent(), and language_writer::indented_output_stream.
Referenced by get_extension().
|
overridevirtual |
Write the declaration of internal objects of the module.
cir | is the module to be written. |
Implements language_writer.
Definition at line 491 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), channel_o_K, component_o_K, HDL_manager::convert_to_identifier(), structural_object::get_kind(), GET_TYPE_NAME, IndentedOutputStream::Indent(), language_writer::indented_output_stream, and THROW_ASSERT.
Referenced by get_extension().
|
overridevirtual |
Module can be parametrized with respect different features.
Port vectors are parametrized with the number of port associated, while ports are parametrized in case the type is a integer with the number of bits. The id of the module is modified by adding the parameters at its end. For example an AND_GATE with a port_vector of 2 will be declared as: AND_GATE_2. Moreover, a multiplier with the first input of four bits, the second input with eight bits and an output of twelve bits will be declared as: MULT_4_8_12. Note that parametrization has a meaning only in case the functionality come from the STD technology library.
cir | is the component to be declared. |
writing memory-related parameters
Generic of owner module
If we reach this point actual parameter of current module is formal parameter of owner module of type memory Since memory parameters are integer and parameter of current module is std_logic_vector conversion has to be added We need to know the size of the generic (name), but this is not possible examining only the current generic At the moment his pattern has been encountered only in constant_value, so we use information about another generic that we know exist int that module
Implements language_writer.
Definition at line 1161 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), BITSIZE_PREFIX, structural_type_descriptor::BOOL, channel_o_K, component_o_K, HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, IndentedOutputStream::Deindent(), structural_object::get_kind(), NP_functionality::get_NP_functionality(), structural_object::get_path(), GET_TYPE_SIZE, structural_object::get_typeRef(), IndentedOutputStream::Indent(), INDENT_DBG_MEX, language_writer::indented_output_stream, structural_type_descriptor::INT, MEMORY_PARAMETER, lenet_tvm::mod, NUM_ELEM_PREFIX, structural_type_descriptor::OTHER, port_vector_o_K, PORTSIZE_PREFIX, structural_type_descriptor::REAL, structural_type_descriptor::size, STD_GET_SIZE, STR, THROW_ASSERT, THROW_UNREACHABLE, TM, structural_type_descriptor::type, test_panda::type, structural_type_descriptor::UINT, structural_type_descriptor::UNKNOWN, structural_type_descriptor::USER, symmetry::value, structural_type_descriptor::VECTOR_BOOL, structural_type_descriptor::VECTOR_INT, structural_type_descriptor::VECTOR_REAL, structural_type_descriptor::vector_size, structural_type_descriptor::VECTOR_UINT, and structural_type_descriptor::VECTOR_USER.
Referenced by get_extension(), and write_module_instance_begin().
|
overridevirtual |
Write the declaration of the module parameters.
writing memory-related parameters
in case first_it is false at least one parameter has used.
Implements language_writer.
Definition at line 2031 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), BITSIZE_PREFIX, structural_type_descriptor::BOOL, channel_o_K, component_o_K, HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::get_id(), structural_object::get_kind(), structural_object::get_kind_text(), NP_functionality::get_NP_functionality(), structural_object::get_typeRef(), INDENT_DBG_MEX, language_writer::indented_output_stream, structural_type_descriptor::INT, MEMORY_PARAMETER, lenet_tvm::mod, NUM_ELEM_PREFIX, NumberToBinaryString(), structural_type_descriptor::OTHER, port_vector_o_K, PORTSIZE_PREFIX, structural_type_descriptor::REAL, THROW_ASSERT, THROW_UNREACHABLE, TM, structural_type_descriptor::type, test_panda::type, structural_type_descriptor::UINT, structural_type_descriptor::UNKNOWN, structural_type_descriptor::USER, symmetry::value, structural_type_descriptor::VECTOR_BOOL, structural_type_descriptor::VECTOR_INT, structural_type_descriptor::VECTOR_REAL, structural_type_descriptor::VECTOR_UINT, and structural_type_descriptor::VECTOR_USER.
Referenced by get_extension(), and write_component_declaration().
|
overridevirtual |
Write in the proper language the behavioral description of the module described in "Not Parsed" form.
cir | is the component. |
manage reset by preprocessing the behavioral description
Implements language_writer.
Definition at line 1987 of file VHDL_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, THROW_ASSERT, and NP_functionality::VHDL_PROVIDED.
Referenced by get_extension().
|
overridevirtual |
Write the binding of a port.
It follows the name binding style.
port | is the port to be bounded. |
top | is the component owner of the component that has the port to be bounded. |
This conversion is needed since vector of bool are mapped on VECTOR_UINT
Implements language_writer.
Definition at line 809 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), structural_type_descriptor::BOOL, constant_o_K, HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, structural_object::get_id(), structural_object::get_kind(), structural_type_descriptor::get_name(), structural_object::get_owner(), structural_object::get_path(), GET_TYPE_SIZE, structural_object::get_typeRef(), INDENT_DBG_MEX, language_writer::indented_output_stream, structural_type_descriptor::INT, may_slice_string(), port_o_K, port_vector_o_K, structural_type_descriptor::REAL, structural_type_descriptor::size, STR, THROW_ASSERT, THROW_UNREACHABLE, structural_type_descriptor::type, type_converter(), structural_type_descriptor::UINT, structural_type_descriptor::VECTOR_BOOL, structural_type_descriptor::VECTOR_INT, and structural_type_descriptor::VECTOR_UINT.
Referenced by get_extension().
|
overridevirtual |
Write the header for port_decl.
Implements language_writer.
Definition at line 2019 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), IndentedOutputStream::Indent(), and language_writer::indented_output_stream.
Referenced by get_extension().
|
overridevirtual |
Write the tail for port_decl.
Implements language_writer.
Definition at line 2025 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), IndentedOutputStream::Deindent(), and language_writer::indented_output_stream.
Referenced by get_extension().
|
overridevirtual |
Write the port declaration starting from a port object.
cir | is the port to be written. |
Implements language_writer.
Definition at line 502 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), HDL_manager::convert_to_identifier(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_typeRef(), language_writer::indented_output_stream, port_o_K, port_vector_o_K, THROW_ASSERT, THROW_ERROR, type_converter(), and type_converter_size().
Referenced by get_extension(), and write_component_declaration().
|
overridevirtual |
write the present_state update process
reset_state | is the reset state. |
reset_port | is the reset port. |
clock_port | is the clock port. |
reset_type | when true the FSM will have an synchronous reset |
Implements language_writer.
Definition at line 1465 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), IndentedOutputStream::Deindent(), IndentedOutputStream::Indent(), language_writer::indented_output_stream, language_writer::parameters, and write_comment().
Referenced by get_extension().
|
overridevirtual |
Write the declaration of a signal.
cir | is the signal to be declared. |
Implements language_writer.
Definition at line 630 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), structural_type_descriptor::BOOL, HDL_manager::convert_to_identifier(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_typeRef(), language_writer::indented_output_stream, signal_o_K, signal_vector_o_K, structural_type_descriptor::size, STR, THROW_UNREACHABLE, structural_type_descriptor::type, type_converter(), type_converter_size(), structural_type_descriptor::VECTOR_BOOL, and structural_type_descriptor::vector_size.
Referenced by get_extension().
|
overridevirtual |
write the declaration of all the states of the finite state machine.
list_of_states | is the list of all the states. |
adjust in case states are not consecutive
Implements language_writer.
Definition at line 1395 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), language_writer::bitnumber(), language_writer::encode_one_hot(), language_writer::indented_output_stream, max, NumberToBinaryString(), language_writer::parameters, STATE_NAME_PREFIX, STR, and write_comment().
Referenced by get_extension().
|
overridevirtual |
Write the transition and output functions.
cir | is the component. |
reset_port | is the reset port. |
clock_port | is the clock port. |
first | if the first iterator of the state table. |
end | if the end iterator of the state table. |
n_states | is the number of states. |
get the default output of the reset state
set the defaults
get the present state
get the current output
check if we can skip this state or transitions
really useful for one-hot encoding
Implements language_writer.
Definition at line 1520 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, IndentedOutputStream::Deindent(), IndentedOutputStream::Indent(), INDENT_DBG_MEX, language_writer::indented_output_stream, lenet_tvm::mod, NEXT_STATE_PORT_NAME, NumberToBinaryString(), PRESENT_STATE_PORT_NAME, starts_with(), STR, THROW_ASSERT, THROW_ERROR, and write_comment().
Referenced by get_extension().
|
overridevirtual |
Implements language_writer.
Definition at line 693 of file VHDL_writer.cpp.
References IndentedOutputStream::Append(), structural_type_descriptor::BOOL, constant_o_K, HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, IndentedOutputStream::Deindent(), structural_object::get_id(), structural_object::get_kind(), structural_object::get_owner(), GET_TYPE_SIZE, IndentedOutputStream::Indent(), INDENT_DBG_MEX, language_writer::indented_output_stream, port_o_K, port_vector_o_K, signal_o_K, signal_vector_o_K, STR, THROW_ASSERT, THROW_UNREACHABLE, and structural_type_descriptor::VECTOR_BOOL.
Referenced by get_extension().
|
overridevirtual |
Write a builtin component.
component | is the component to be printed |
Implements language_writer.
Definition at line 2171 of file VHDL_writer.cpp.
References AND_GATE_STD, IndentedOutputStream::Append(), HDL_manager::convert_to_identifier(), language_writer::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, GET_TYPE_NAME, INDENT_DBG_MEX, language_writer::indented_output_stream, lenet_tvm::mod, OR_GATE_STD, port_o_K, port_vector_o_K, STR, THROW_ASSERT, and THROW_UNREACHABLE.
Referenced by has_output_prefix().
|
staticprotected |
Definition at line 57 of file VHDL_writer.hpp.
Referenced by check_keyword_vhdl().
|
protected |
Definition at line 59 of file VHDL_writer.hpp.
Referenced by write_component_declaration(), and write_module_declaration().
|
protected |
The technology manager.
Definition at line 62 of file VHDL_writer.hpp.
Referenced by write_module_parametrization(), and write_module_parametrization_decl().