modify(types): add derive(Debug)

This commit is contained in:
Wataru Otsubo 2025-01-29 21:19:44 +09:00
parent 99e98c9320
commit f2a7a5a28b

View file

@ -1,3 +1,4 @@
#[derive(Debug)]
pub struct Module { pub struct Module {
pub name: String, pub name: String,
pub addr: u32, pub addr: u32,
@ -9,6 +10,7 @@ pub struct Module {
pub elements_other: Vec<ModuleBlockElements>, pub elements_other: Vec<ModuleBlockElements>,
} }
#[derive(Debug)]
pub enum ModuleBlockElements { pub enum ModuleBlockElements {
Block(Block), Block(Block),
Register(Register), Register(Register),
@ -16,6 +18,7 @@ pub enum ModuleBlockElements {
Fifo(Fifo), Fifo(Fifo),
} }
#[derive(Debug)]
pub struct BitString { pub struct BitString {
pub name: String, pub name: String,
pub size: Option<u32>, pub size: Option<u32>,
@ -25,6 +28,7 @@ pub struct BitString {
pub elements_field: Vec<Field>, pub elements_field: Vec<Field>,
} }
#[derive(Debug)]
pub struct Block { pub struct Block {
pub name: String, pub name: String,
/// Fill this with proper calc. /// Fill this with proper calc.
@ -42,6 +46,7 @@ pub struct Block {
pub elements: Vec<ModuleBlockElements>, pub elements: Vec<ModuleBlockElements>,
} }
#[derive(Debug)]
pub struct Register { pub struct Register {
pub name: String, pub name: String,
/// Fill this with proper calc. /// Fill this with proper calc.
@ -56,6 +61,7 @@ pub struct Register {
pub elements: Vec<Field>, pub elements: Vec<Field>,
} }
#[derive(Debug)]
pub struct Memory { pub struct Memory {
pub name: String, pub name: String,
/// Fill this with proper calc. /// Fill this with proper calc.
@ -70,6 +76,7 @@ pub struct Memory {
pub elements: Vec<Field>, pub elements: Vec<Field>,
} }
#[derive(Debug)]
pub struct Fifo { pub struct Fifo {
pub name: String, pub name: String,
/// Fill this with proper calc. /// Fill this with proper calc.
@ -86,6 +93,7 @@ pub struct Fifo {
} }
// TODO // TODO
#[derive(Debug)]
pub struct Field { pub struct Field {
pub name: String, pub name: String,
/// TODO: is this optional? /// TODO: is this optional?
@ -101,12 +109,14 @@ pub struct Field {
pub elements: Vec<Value>, pub elements: Vec<Value>,
} }
#[derive(Debug)]
pub struct Value { pub struct Value {
pub name: String, pub name: String,
pub data: u32, pub data: u32,
pub desc: Option<String> pub desc: Option<String>
} }
#[derive(Debug)]
pub enum AmodValues { pub enum AmodValues {
A16, A16,
A24, A24,
@ -116,21 +126,25 @@ pub enum AmodValues {
USER2, USER2,
} }
#[derive(Debug)]
pub enum DataType { pub enum DataType {
D32, D32,
} }
#[derive(Debug)]
pub enum RwSpecifier { pub enum RwSpecifier {
R, R,
W, W,
RW, RW,
} }
#[derive(Debug)]
pub struct MultipleParams { pub struct MultipleParams {
pub multiple: u32, pub multiple: u32,
pub offset: u32, pub offset: u32,
} }
#[derive(Debug)]
pub enum FieldFifoInterface { pub enum FieldFifoInterface {
Vector, Vector,
Block, Block,