XiPU uROM Generator
uromdata.h
Go to the documentation of this file.
1 /*
2  * Author: Pawel Jablonski
3  * E-mail: pj@xirx.net
4  * WWW: xirx.net
5  * GIT: git.xirx.net
6  *
7  * License: You can use this code however you like
8  * but leave information about the original author.
9  * Code is free for non-commercial and commercial use.
10  */
11 
12 #ifndef UROMDATA_H
13 #define UROMDATA_H
14 
15 #include <QString>
16 #include <QFile>
17 #include <QVector>
18 
19 #include "instruction.h"
20 
21 //! This class contains a whole generated microcode for all instructions
22 class URomData
23 {
24  public:
25  static const int INSTRUCTION_QUANTITY = 256; //!< Support only for 256 opcodes
26  static const int INSTRUCTION_CYCLE_QUANTITY = 16; //!< Every instruction can get only 16 steps
27 
28  static const int ADDRESS_FLAG_C_POSITION = 12; //!< Position of the carry bit received from ALU to the control unit
29  static const int ADDRESS_FLAG_Z_POSITION = 13; //!< Position of the zero bit received from ALU to the control unit
30 
31  static const int UROM_SIZE = 32768; //!< uROM size for low and high banks
32 
33  URomData();
34 
35  void addInstruction(const Instruction &instruction);
36  bool saveFiles(const QString &urom0Path, const QString &urom1Path);
37 
38  private:
39  //! Data container for low and high banks
40  QVector<QVector<unsigned char>> data = { QVector<unsigned char>(UROM_SIZE), QVector<unsigned char>(UROM_SIZE) };
41 };
42 
43 #endif
This class contains atomic steps for the control unit of defined instruction.
Definition: instruction.h:21
This class contains a whole generated microcode for all instructions.
Definition: uromdata.h:23
static const int INSTRUCTION_CYCLE_QUANTITY
Every instruction can get only 16 steps.
Definition: uromdata.h:26
URomData()
Default constructor for creating an empty uROM opcode table.
Definition: uromdata.cpp:15
static const int ADDRESS_FLAG_Z_POSITION
Position of the zero bit received from ALU to the control unit.
Definition: uromdata.h:29
static const int INSTRUCTION_QUANTITY
Support only for 256 opcodes.
Definition: uromdata.h:25
bool saveFiles(const QString &urom0Path, const QString &urom1Path)
Definition: uromdata.cpp:82
static const int UROM_SIZE
uROM size for low and high banks
Definition: uromdata.h:31
void addInstruction(const Instruction &instruction)
Definition: uromdata.cpp:26
static const int ADDRESS_FLAG_C_POSITION
Position of the carry bit received from ALU to the control unit.
Definition: uromdata.h:28
QVector< QVector< unsigned char > > data
Data container for low and high banks.
Definition: uromdata.h:40