srecord: output/file/vhdl.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
vhdl.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 2000 Hendrik De Vloed <hendrik.devloed@ugent.be>
4// Copyright (C) 2006-2008, 2010 Peter Miller
5//
6// This program is free software; you can redistribute it and/or modify it
7// under the terms of the GNU Lesser General Public License as published by
8// the Free Software Foundation; either version 3 of the License, or (at
9// your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
14// General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with this program. If not, see <http://www.gnu.org/licenses/>.
18//
19
20#ifndef SRECORD_OUTPUT_FILE_VHDL_H
21#define SRECORD_OUTPUT_FILE_VHDL_H
22
23#include <srecord/output/file.h>
24
25namespace srecord
26{
27
28/**
29 * The srecord::output_file_vhdl class is used to represent the state out
30 * an output file in VHDL format.
31 */
32 class output_file_vhdl:
33 public output_file
34{
35public:
36 /**
37 * The destructor.
38 */
39 virtual ~output_file_vhdl();
40
41private:
42 /**
43 * The constructor. It is private on purpose, use the #create
44 * class method instead.
45 *
46 * @param file_name
47 * The name of the file to be written. The special name "-"
48 * indicates the standard output is to be used.
49 */
50 output_file_vhdl(const std::string &file_name);
51
52public:
53 /**
54 * The create class method is used to create new dynamically
55 * allocated instances of this class.
56 *
57 * @param file_name
58 * The name of the file to be written.
59 */
60 static pointer create(const std::string &file_name);
61
62protected:
63 // See base class for documentation
64 void write(const record &);
65
66 // See base class for documentation
67 void line_length_set(int);
68
69 // See base class for documentation
70 void address_length_set(int);
71
72 // See base class for documentation
73 int preferred_block_size_get() const;
74
75 // See base class for documentation.
76 bool preferred_block_size_set(int nbytes);
77
78 // See base class for documentation
79 void command_line(arglex_tool *cmdln);
80
81 // See base class for documentation.
82 const char *format_name() const;
83
84private:
85 /**
86 * The bytes_per_word instance variable is used to remember how
87 * many bytes to emit per output row. This is because words are
88 * packed into an arry of values larger than a single byte.
89 */
90 unsigned bytes_per_word;
91
92 /**
93 * The prefix instance variable is used to remember the prefix of
94 * the various names emitted into the output.
95 */
96 std::string prefix;
97
98 /**
99 * The header_done instance variable is used to remember whether
100 * the emit_header method has already been called.
101 */
102 bool header_done;
103
104 /**
105 * The emit_header method is used to emit the file header,
106 * if necessary.
107 */
108 void emit_header();
109
110 /**
111 * The default constructor. Do not use.
112 */
113 output_file_vhdl();
114
115 /**
116 * The copy constructor. Do not use.
117 */
118 output_file_vhdl(const output_file_vhdl &);
119
120 /**
121 * The assignment operator. Do not use.
122 */
123 output_file_vhdl &operator=(const output_file_vhdl &);
124};
125
126};
127
128#endif // SRECORD_OUTPUT_FILE_VHDL_H
srecord::arglex_tool
The srecord::arglex_tool is used to parse command line with srec-specific arguments.
Definition tool.h:41
srecord::output_file_vhdl::command_line
void command_line(arglex_tool *cmdln)
The command_line method is used by arglex_srec::get_output when parsing the command line,...
srecord::output_file_vhdl::write
void write(const record &)
The write method is used to write a recordonto an output.
srecord::output_file_vhdl::create
static pointer create(const std::string &file_name)
The create class method is used to create new dynamically allocated instances of this class.
srecord::output_file_vhdl::preferred_block_size_set
bool preferred_block_size_set(int nbytes)
The preferred_block_size_set method is is to set a precific number of bytes for the preferred block s...
srecord::output_file_vhdl::preferred_block_size_get
int preferred_block_size_get() const
The preferred_block_size_get method is used to get the proferred block size of the output fformat.
srecord::output_file_vhdl::line_length_set
void line_length_set(int)
The set_line_length method is used to set the maximum length of an output line, for those formats for...
srecord::output_file_vhdl::address_length_set
void address_length_set(int)
The address_length_set method is used to set the minimum number of bytes to be written for addresses ...
srecord::output_file_vhdl::format_name
const char * format_name() const
The format_name method is used to obtain the name of this output format.
srecord::output_file_vhdl::~output_file_vhdl
virtual ~output_file_vhdl()
The destructor.
srecord::output_file::output_file
output_file()
The default constructor.
srecord::output::pointer
std::shared_ptr< output > pointer
Definition output.h:41
srecord::record
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
srecord
Definition adler16.h:25
file.h