XiPU uROM Generator
Step Class Reference

#include <step.h>

Collaboration diagram for Step:
[legend]

Public Types

enum class  BusAR {
  ABXY = 0 , D , IN , T ,
  Ram , Flash , PCL , PCH ,
  Default = 0
}
 Line select defines for the main reading data bus. More...
 
enum class  BusAW {
  None = 0 , ABXY , D , OUT ,
  ALU_T , RPC , I , Ram ,
  PCL , PCH , MAL , MAH ,
  PC_PLUS , SP_PLUS , SP_MINUS , RPC_PLUS
}
 Line select defines for the main writing data bus. More...
 
enum class  BusB { AB = 0 , D , Default = 0 }
 Line select defines for the secondary reading data bus. More...
 
enum class  BusC {
  PC = 0 , MA , SP , XY ,
  Default = 0
}
 Line select defines for the addressing data bus. More...
 

Public Member Functions

 Step (BusAR busAR, BusAW busAW, BusB busB=BusB::Default, BusC busC=BusC::Default, unsigned char aluS=0, bool aluM=false, bool aluC=false)
 
const UCodegetUCode () const
 

Static Public Attributes

static const int CODE_0_BUS_AR_POSITION = 0
 Position of bits for the main reading data bus. More...
 
static const int CODE_0_BUS_AW_POSITION = 3
 Position of bits for the main writing data bus. More...
 
static const int CODE_0_BUS_B_POSITION = 7
 Position of bits for the secondary reading data bus. More...
 
static const int CODE_1_BUS_C_POSITION = 0
 Position of bits for the addressing data bus. More...
 
static const int CODE_1_FLAG_S_POSITION = 2
 Position of bits for the ALU_S flags. More...
 
static const int CODE_1_FLAG_M_POSITION = 6
 Position of bit for the ALU_M flag. More...
 
static const int CODE_1_FLAG_C_POSITION = 7
 Position of bit for the ALU_C flag. More...
 
static const int CODE_FLAG_S_MASK = 0x0f
 Mask for ALU_S flags. More...
 

Private Attributes

UCode uCode
 Parsed microcode for the current step. More...
 

Detailed Description

This class contains a single step of the instruction. It is a raw describe how to set control lines for the step.

Definition at line 23 of file step.h.

Member Enumeration Documentation

◆ BusAR

enum Step::BusAR
strong

Line select defines for the main reading data bus.

Enumerator
ABXY 

Main and auxiliary registers.

Hidden data register.

IN 

Input register.

ALU temp register.

Ram 

RAM access.

Flash 

FLASH access.

PCL 

Program Counter Low register.

PCH 

Program Counter High register.

Default 

Definition at line 38 of file step.h.

39  {
40  ABXY = 0, //!< Main and auxiliary registers
41  D, //!< Hidden data register
42  IN, //!< Input register
43  T, //!< ALU temp register
44  Ram, //!< RAM access
45  Flash, //!< FLASH access
46  PCL, //!< Program Counter Low register
47  PCH, //!< Program Counter High register
48  Default = 0
49  };

◆ BusAW

enum Step::BusAW
strong

Line select defines for the main writing data bus.

Enumerator
None 

Not selected.

ABXY 

Main and auxiliary registers.

Hidden data register.

OUT 

Output register.

ALU_T 

ALU operation.

RPC 

Reset Program Counter.

Instruction register.

Ram 

RAM access.

PCL 

Program Counter Low register.

PCH 

Program Counter High register.

MAL 

Memory Address Low register.

MAH 

Memory Address High register.

PC_PLUS 

Increse Program Counter.

SP_PLUS 

Increse Stack Pointer.

SP_MINUS 

Decrese Stack Pointer.

RPC_PLUS 

Reset the step counter and increse Program Counter.

Definition at line 52 of file step.h.

53  {
54  None = 0, //!< Not selected
55  ABXY, //!< Main and auxiliary registers
56  D, //!< Hidden data register
57  OUT, //!< Output register
58  ALU_T, //!< ALU operation
59  RPC, //!< Reset Program Counter
60  I, //!< Instruction register
61  Ram, //!< RAM access
62  PCL, //!< Program Counter Low register
63  PCH, //!< Program Counter High register
64  MAL, //!< Memory Address Low register
65  MAH, //!< Memory Address High register
66  PC_PLUS, //!< Increse Program Counter
67  SP_PLUS, //!< Increse Stack Pointer
68  SP_MINUS, //!< Decrese Stack Pointer
69  RPC_PLUS //!< Reset the step counter and increse Program Counter
70  };

◆ BusB

enum Step::BusB
strong

Line select defines for the secondary reading data bus.

Enumerator
AB 

Main registers.

Hidden data register.

Default 

Definition at line 73 of file step.h.

74  {
75  AB = 0, //!< Main registers
76  D, //!< Hidden data register
77  Default = 0
78  };

◆ BusC

enum Step::BusC
strong

Line select defines for the addressing data bus.

Enumerator
PC 

Full 16 bit Program Counter register.

MA 

Full 16 bit Memory Address register.

SP 

Full 16 bit Stack Pointer register.

XY 

Full 16 bit auxiliary register.

Default 

Definition at line 81 of file step.h.

82  {
83  PC = 0, //!< Full 16 bit Program Counter register
84  MA, //!< Full 16 bit Memory Address register
85  SP, //!< Full 16 bit Stack Pointer register
86  XY, //!< Full 16 bit auxiliary register
87  Default = 0
88  };

Constructor & Destructor Documentation

◆ Step()

Step::Step ( BusAR  busAR,
BusAW  busAW,
BusB  busB = BusB::Default,
BusC  busC = BusC::Default,
unsigned char  aluS = 0,
bool  aluM = false,
bool  aluC = false 
)

Step constructor

Parameters
busARWhich line of the main reading data bus is selected
busAWWhich line of the main writing data bus is selected
busBWhich line of the secondary reading data bus is selected
busCWhich line of the addressing data bus is selected
aluSSeleted bits for ALU_S flags
aluMSeleted bit for ALU_M flag
aluCSeleted bit for ALU_C flag

Definition at line 25 of file step.cpp.

26 {
27  QVector<unsigned char> code = { 0, 0 };
28 
29  code[0] |= (static_cast<unsigned char>(busAR) << CODE_0_BUS_AR_POSITION);
30  code[0] |= (static_cast<unsigned char>(busAW) << CODE_0_BUS_AW_POSITION);
31  code[0] |= (static_cast<unsigned char>(busB) << CODE_0_BUS_B_POSITION);
32 
33  code[1] |= (static_cast<unsigned char>(busC) << CODE_1_BUS_C_POSITION);
34  code[1] |= ((aluS & CODE_FLAG_S_MASK) << CODE_1_FLAG_S_POSITION);
35  code[1] |= ((aluM ? 1 : 0) << CODE_1_FLAG_M_POSITION);
36  code[1] |= ((aluC ? 1 : 0) << CODE_1_FLAG_C_POSITION);
37 
38  this->uCode = UCode(code[0], code[1]);
39 }
static const int CODE_1_BUS_C_POSITION
Position of bits for the addressing data bus.
Definition: step.h:30
static const int CODE_FLAG_S_MASK
Mask for ALU_S flags.
Definition: step.h:35
static const int CODE_0_BUS_B_POSITION
Position of bits for the secondary reading data bus.
Definition: step.h:28
static const int CODE_0_BUS_AR_POSITION
Position of bits for the main reading data bus.
Definition: step.h:26
static const int CODE_1_FLAG_S_POSITION
Position of bits for the ALU_S flags.
Definition: step.h:31
UCode uCode
Parsed microcode for the current step.
Definition: step.h:95
static const int CODE_1_FLAG_M_POSITION
Position of bit for the ALU_M flag.
Definition: step.h:32
static const int CODE_1_FLAG_C_POSITION
Position of bit for the ALU_C flag.
Definition: step.h:33
static const int CODE_0_BUS_AW_POSITION
Position of bits for the main writing data bus.
Definition: step.h:27
This class contains a parsed microcode of the single step.
Definition: ucode.h:19

References CODE_0_BUS_AR_POSITION, CODE_0_BUS_AW_POSITION, CODE_0_BUS_B_POSITION, CODE_1_BUS_C_POSITION, CODE_1_FLAG_C_POSITION, CODE_1_FLAG_M_POSITION, CODE_1_FLAG_S_POSITION, CODE_FLAG_S_MASK, and uCode.

Member Function Documentation

◆ getUCode()

const UCode & Step::getUCode ( ) const

Get a parsed microcode for the current step

Returns
Parsed microcode

Definition at line 46 of file step.cpp.

47 {
48  return(this->uCode);
49 }

References uCode.

Referenced by URomData::addInstruction().

Here is the caller graph for this function:

Field Documentation

◆ CODE_0_BUS_AR_POSITION

const int Step::CODE_0_BUS_AR_POSITION = 0
static

Position of bits for the main reading data bus.

Definition at line 26 of file step.h.

Referenced by Step().

◆ CODE_0_BUS_AW_POSITION

const int Step::CODE_0_BUS_AW_POSITION = 3
static

Position of bits for the main writing data bus.

Definition at line 27 of file step.h.

Referenced by Step().

◆ CODE_0_BUS_B_POSITION

const int Step::CODE_0_BUS_B_POSITION = 7
static

Position of bits for the secondary reading data bus.

Definition at line 28 of file step.h.

Referenced by Step().

◆ CODE_1_BUS_C_POSITION

const int Step::CODE_1_BUS_C_POSITION = 0
static

Position of bits for the addressing data bus.

Definition at line 30 of file step.h.

Referenced by Step().

◆ CODE_1_FLAG_C_POSITION

const int Step::CODE_1_FLAG_C_POSITION = 7
static

Position of bit for the ALU_C flag.

Definition at line 33 of file step.h.

Referenced by Step().

◆ CODE_1_FLAG_M_POSITION

const int Step::CODE_1_FLAG_M_POSITION = 6
static

Position of bit for the ALU_M flag.

Definition at line 32 of file step.h.

Referenced by Step().

◆ CODE_1_FLAG_S_POSITION

const int Step::CODE_1_FLAG_S_POSITION = 2
static

Position of bits for the ALU_S flags.

Definition at line 31 of file step.h.

Referenced by Step().

◆ CODE_FLAG_S_MASK

const int Step::CODE_FLAG_S_MASK = 0x0f
static

Mask for ALU_S flags.

Definition at line 35 of file step.h.

Referenced by Step().

◆ uCode

UCode Step::uCode
private

Parsed microcode for the current step.

Definition at line 95 of file step.h.

Referenced by getUCode(), and Step().


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