sim_types.h File Reference

yasimavr: sim_types.h File Reference
yasimavr
Loading...
Searching...
No Matches
sim_types.h File Reference
#include "sim_globals.h"
#include <stdint.h>
#include <string>
#include <vector>
#include <span>
#include <climits>

Go to the source code of this file.

Classes

class  reg_addr_t
 Representation of a I/O register address, with validity state. More...
 
struct  bitmask_t
 Bit mask structure for bitwise operations on 8-bits registers. More...
 
struct  regmask_t
 Address + bit mask structure. More...
 
class  bitspec_t
 bit spec structure. Represent a field in a I/O register. It works the same as bitmask_t except used bits must be consecutive More...
 
class  regbit_t
 Represents a field in a I/O register with address. More...
 
class  regbit_compound_t
 
class  vardata_t
 
class  sim_id_t
 Representation of a ID internally represented as a 64-bits integer but can be initialised with a string. More...
 

Macros

#define BITSET(v, b)   (((v) >> (b)) & 0x01)
 

Typedefs

typedef unsigned long mem_addr_t
 
typedef unsigned long flash_addr_t
 
typedef short int_vect_t
 
typedef std::vector< uint8_t > bytes_t
 
typedef std::span< const uint8_t > bytes_view_t
 
typedef sim_id_t ctl_id_t
 

Functions

constexpr uint8_t operator| (uint8_t v, const bitmask_t &m)
 
constexpr uint8_t operator& (uint8_t v, const bitmask_t &m)
 
constexpr uint8_t operator^ (uint8_t v, const bitmask_t &m)
 
uint8_t & operator|= (uint8_t &v, const bitmask_t &m)
 
uint8_t & operator&= (uint8_t &v, const bitmask_t &m)
 
uint8_t & operator^= (uint8_t &v, const bitmask_t &m)
 
constexpr bool operator== (reg_addr_t a, const regmask_t &rm)
 
constexpr bool operator!= (reg_addr_t a, const regmask_t &rm)
 
std::ostream & operator<< (std::ostream &o, const sim_id_t &id)
 

Variables

YASIMAVR_BEGIN_NAMESPACE typedef long long cycle_count_t
 
const cycle_count_t INVALID_CYCLE = -1
 
constexpr reg_addr_t INVALID_REGISTER
 

Macro Definition Documentation

◆ BITSET

#define BITSET (   v,
 
)    (((v) >> (b)) & 0x01)

Typedef Documentation

◆ bytes_t

typedef std::vector<uint8_t> bytes_t

◆ bytes_view_t

typedef std::span<const uint8_t> bytes_view_t

◆ ctl_id_t

typedef sim_id_t ctl_id_t

◆ flash_addr_t

typedef unsigned long flash_addr_t

◆ int_vect_t

typedef short int_vect_t

◆ mem_addr_t

typedef unsigned long mem_addr_t

Function Documentation

◆ operator!=()

constexpr bool operator!= ( reg_addr_t  a,
const regmask_t rm 
)
constexpr

◆ operator&()

constexpr uint8_t operator& ( uint8_t  v,
const bitmask_t m 
)
constexpr

◆ operator&=()

uint8_t & operator&= ( uint8_t &  v,
const bitmask_t m 
)
inline

◆ operator<<()

std::ostream & operator<< ( std::ostream &  o,
const sim_id_t id 
)

◆ operator==()

constexpr bool operator== ( reg_addr_t  a,
const regmask_t rm 
)
constexpr

◆ operator^()

constexpr uint8_t operator^ ( uint8_t  v,
const bitmask_t m 
)
constexpr

◆ operator^=()

uint8_t & operator^= ( uint8_t &  v,
const bitmask_t m 
)
inline

◆ operator|()

constexpr uint8_t operator| ( uint8_t  v,
const bitmask_t m 
)
constexpr

◆ operator|=()

uint8_t & operator|= ( uint8_t &  v,
const bitmask_t m 
)
inline

Variable Documentation

◆ cycle_count_t

YASIMAVR_BEGIN_NAMESPACE typedef long long cycle_count_t

◆ INVALID_CYCLE

const cycle_count_t INVALID_CYCLE = -1

◆ INVALID_REGISTER

constexpr reg_addr_t INVALID_REGISTER
constexpr