Go to the documentation of this file.
56 std::ostream& warningStream,
57 std::ostream& errorStream):
59 integrator, warningStream, errorStream) {
93 std::vector<TCEString>
101 file.open(outputFile.c_str());
103 TCEString msg =
"Couldn't open file " + outputFile +
" for writing";
104 IOException exc(__FILE__, __LINE__,
"VhdlRomGenerator", msg);
110 std::ostringstream stream;
112 <<
"library ieee;" << endl
113 <<
"use ieee.std_logic_1164.all;" << endl
114 <<
"use ieee.std_logic_arith.all;" << endl
116 <<
"entity " <<
moduleName() <<
" is" << endl << endl
117 << indentL1 <<
"generic (" << endl
118 << indentL2 <<
"addrw : integer := 10;" << endl
119 << indentL2 <<
"instrw : integer := 100);" << endl
120 << indentL1 <<
"port (" << endl
121 << indentL2 <<
"clock : in std_logic;" << endl
122 << indentL2 <<
"en_x : in std_logic; -- not used" << endl
123 << indentL2 <<
"addr : in std_logic_vector(addrw-1 downto 0);"
125 <<
"dataout : out std_logic_vector(instrw-1 downto 0));" << endl
126 <<
"end " <<
moduleName() <<
";" << endl << endl;
129 <<
"architecture rtl of " <<
moduleName() <<
" is" << endl << endl
131 <<
"subtype imem_index is integer range 0 to imem_array'length-1;"
133 << indentL1 <<
"constant imem : std_logic_imem_matrix"
134 <<
"(0 to imem_array'length-1) := imem_array;" << endl
135 << indentL1 <<
"signal en_x_dummy : std_logic;" << endl << endl
136 <<
"begin --rtl" << endl << endl
137 << indentL1 <<
"process" << endl
138 << indentL2 <<
"variable imem_line : imem_index;" << endl
139 << indentL1 <<
"begin -- process" << endl
140 << indentL2 <<
"wait until clock'event and clock='1';" << endl
141 << indentL2 <<
"imem_line := conv_integer(unsigned(addr));" << endl
142 << indentL2 <<
"dataout <= imem(imem_line);" << endl
143 << indentL1 <<
"end process;" << endl << endl
144 << indentL1 <<
"en_x_dummy <= en_x; -- dummy connection" << endl
145 << endl <<
"end rtl;" << endl;
147 file << stream.str();
150 std::vector<TCEString> componentFiles;
151 componentFiles.push_back(outputFile);
153 return componentFiles;
@ GND
All port signals set to low.
TCEString initializationFile() const
void addPort(const TCEString &name, HDLPort *port)
@ BIT_VECTOR
Several bits.
TCEString ttaCoreName() const
virtual ~VhdlRomGenerator()
TCEString memoryIndexString(int coreId, int memIndex) const
virtual std::vector< TCEString > generateComponentFile(TCEString outputPath)
virtual TCEString moduleName() const
static const std::string DIRECTORY_SEPARATOR
virtual TCEString instanceName(int coreId, int memIndex) const
TCEString imagePackageName() const
void setToStatic(ProGe::StaticSignal value)
void addParameter(const ProGe::Parameter &add)
virtual bool generatesComponentHdlFile() const
int memoryTotalWidth() const
int memoryAddrWidth() const
VhdlRomGenerator(int memMauWidth, int widthInMaus, int addrWidth, TCEString initFile, const PlatformIntegrator *integrator, std::ostream &warningStream, std::ostream &errorStream)