OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
VhdlProgramImageWriter Class Reference

#include <VhdlProgramImageWriter.hh>

Inheritance diagram for VhdlProgramImageWriter:
Inheritance graph
Collaboration diagram for VhdlProgramImageWriter:
Collaboration graph

Public Member Functions

 VhdlProgramImageWriter (const InstructionBitVector &bits, const std::string &entityName)
 
virtual ~VhdlProgramImageWriter ()
 
virtual void writeImage (std::ostream &stream) const
 
- Public Member Functions inherited from ArrayProgramImageWriter
 ArrayProgramImageWriter (const InstructionBitVector &bits)
 
virtual ~ArrayProgramImageWriter ()
 
- Public Member Functions inherited from ArrayImageWriter
 ArrayImageWriter (const BitVector &bits, int rowLength)
 
virtual ~ArrayImageWriter ()
 
- Public Member Functions inherited from AsciiImageWriter
 AsciiImageWriter (const BitVector &bits, int rowLength)
 
virtual ~AsciiImageWriter ()
 
- Public Member Functions inherited from BitImageWriter
virtual ~BitImageWriter ()
 

Private Member Functions

void writeHeader (std::ostream &stream) const
 
void writeEnding (std::ostream &stream) const
 
std::string packageName () const
 

Private Attributes

std::string entityName_
 

Additional Inherited Members

- Protected Member Functions inherited from AsciiImageWriter
const BitVectorbits () const
 
int rowLength () const
 
void writeSequence (std::ostream &stream, int length, bool padEnd=false) const
 
void writeHexSequence (std::ostream &stream, int length, bool padEnd=false) const
 

Detailed Description

Writes the (instruction) bit image to a vhdl package.

Definition at line 43 of file VhdlProgramImageWriter.hh.

Constructor & Destructor Documentation

◆ VhdlProgramImageWriter()

VhdlProgramImageWriter::VhdlProgramImageWriter ( const InstructionBitVector bits,
const std::string &  entityName 
)

The constructor.

Parameters
bitsThe bits to write.
rowLengthLength of the rows to write.

Definition at line 45 of file VhdlProgramImageWriter.cc.

◆ ~VhdlProgramImageWriter()

VhdlProgramImageWriter::~VhdlProgramImageWriter ( )
virtual

The destructor.

Definition at line 53 of file VhdlProgramImageWriter.cc.

53 {
54}

Member Function Documentation

◆ packageName()

std::string VhdlProgramImageWriter::packageName ( ) const
private

Definition at line 97 of file VhdlProgramImageWriter.cc.

97 {
98
99 std::string package = "imem_image";
100 if (!entityName_.empty()) {
101 package = entityName_ + "_" + package;
102 }
103 return package;
104}

Referenced by writeEnding(), and writeHeader().

◆ writeEnding()

void VhdlProgramImageWriter::writeEnding ( std::ostream &  stream) const
private

Writes the end declarations to the stream

Definition at line 91 of file VhdlProgramImageWriter.cc.

91 {
92 stream << ");" << endl << endl
93 << "end " << packageName() << ";" << endl;
94}
std::string packageName() const

References packageName().

Referenced by writeImage().

Here is the call graph for this function:

◆ writeHeader()

void VhdlProgramImageWriter::writeHeader ( std::ostream &  stream) const
private

Writes the vhdl declaration stuff to the beginning of the stream

Definition at line 71 of file VhdlProgramImageWriter.cc.

71 {
72 stream << "library ieee;" << endl
73 << "use ieee.std_logic_1164.all;" << endl
74 << "use ieee.std_logic_arith.all;" << endl
75 << "use work.";
76 if (!entityName_.empty()) {
77 stream << entityName_ << "_";
78 }
79 stream << "imem_mau.all;" << endl << endl;
80
81 stream << "package " << packageName() << " is" << endl << endl
82 << " type std_logic_imem_matrix is array (natural range <>) of "
83 << "std_logic_vector(IMEMMAUWIDTH-1 downto 0);" << endl << endl;
84
85 stream << " constant imem_array : std_logic_imem_matrix := (" << endl;
86}

References entityName_, and packageName().

Referenced by writeImage().

Here is the call graph for this function:

◆ writeImage()

void VhdlProgramImageWriter::writeImage ( std::ostream &  stream) const
virtual

Writes the bit image to the given stream.

Parameters
streamThe stream to write.

Reimplemented from ArrayProgramImageWriter.

Definition at line 62 of file VhdlProgramImageWriter.cc.

62 {
63 writeHeader(stream);
65 writeEnding(stream);
66}
virtual void writeImage(std::ostream &stream) const
void writeHeader(std::ostream &stream) const
void writeEnding(std::ostream &stream) const

References writeEnding(), writeHeader(), and ArrayProgramImageWriter::writeImage().

Here is the call graph for this function:

Member Data Documentation

◆ entityName_

std::string VhdlProgramImageWriter::entityName_
private

Definition at line 58 of file VhdlProgramImageWriter.hh.

Referenced by writeHeader().


The documentation for this class was generated from the following files: