
// This file was autogenerated by PeakRDL-uvm
package atxmega_spi_uvm_pkg;
    `include "uvm_macros.svh"
    import uvm_pkg::*;
    
    // Reg - atxmega_spi::CTRL
    class atxmega_spi__CTRL extends uvm_reg;
        rand uvm_reg_field PRESCALER;
        rand uvm_reg_field MODE;
        rand uvm_reg_field MASTER;
        rand uvm_reg_field DORD;
        rand uvm_reg_field ENABLE;
        rand uvm_reg_field CLK2X;

        function new(string name = "atxmega_spi__CTRL");
            super.new(name, 8, UVM_NO_COVERAGE);
        endfunction : new

        virtual function void build();
            this.PRESCALER = new("PRESCALER");
            this.PRESCALER.configure(this, 2, 0, "RW", 0, 'h0, 1, 1, 0);
            this.MODE = new("MODE");
            this.MODE.configure(this, 2, 2, "RW", 0, 'h0, 1, 1, 0);
            this.MASTER = new("MASTER");
            this.MASTER.configure(this, 1, 4, "RW", 1, 'h0, 1, 1, 0);
            this.DORD = new("DORD");
            this.DORD.configure(this, 1, 5, "RW", 0, 'h0, 1, 1, 0);
            this.ENABLE = new("ENABLE");
            this.ENABLE.configure(this, 1, 6, "RW", 0, 'h0, 1, 1, 0);
            this.CLK2X = new("CLK2X");
            this.CLK2X.configure(this, 1, 7, "RW", 0, 'h0, 1, 1, 0);
        endfunction : build
    endclass : atxmega_spi__CTRL

    // Reg - atxmega_spi::INTCTRL
    class atxmega_spi__INTCTRL extends uvm_reg;
        rand uvm_reg_field INTLVL;

        function new(string name = "atxmega_spi__INTCTRL");
            super.new(name, 8, UVM_NO_COVERAGE);
        endfunction : new

        virtual function void build();
            this.INTLVL = new("INTLVL");
            this.INTLVL.configure(this, 2, 0, "RW", 0, 'h0, 1, 1, 0);
        endfunction : build
    endclass : atxmega_spi__INTCTRL

    // Reg - atxmega_spi::STATUS
    class atxmega_spi__STATUS extends uvm_reg;
        rand uvm_reg_field WRCOL;
        rand uvm_reg_field IF;

        function new(string name = "atxmega_spi__STATUS");
            super.new(name, 8, UVM_NO_COVERAGE);
        endfunction : new

        virtual function void build();
            this.WRCOL = new("WRCOL");
            this.WRCOL.configure(this, 1, 6, "RO", 1, 'h0, 1, 1, 0);
            this.IF = new("IF");
            this.IF.configure(this, 1, 7, "RO", 1, 'h0, 1, 1, 0);
        endfunction : build
    endclass : atxmega_spi__STATUS

    // Reg - atxmega_spi::DATA
    class atxmega_spi__DATA extends uvm_reg;
        rand uvm_reg_field WDATA;
        rand uvm_reg_field RDATA;

        function new(string name = "atxmega_spi__DATA");
            super.new(name, 8, UVM_NO_COVERAGE);
        endfunction : new

        virtual function void build();
            this.WDATA = new("WDATA");
            this.WDATA.configure(this, 8, 0, "WO", 0, 'h0, 0, 1, 0);
            this.RDATA = new("RDATA");
            this.RDATA.configure(this, 8, 0, "RO", 1, 'h0, 0, 1, 0);
        endfunction : build
    endclass : atxmega_spi__DATA

    // Addrmap - atxmega_spi
    class atxmega_spi extends uvm_reg_block;
        rand atxmega_spi__CTRL CTRL;
        rand atxmega_spi__INTCTRL INTCTRL;
        rand atxmega_spi__STATUS STATUS;
        rand atxmega_spi__DATA DATA;

        function new(string name = "atxmega_spi");
            super.new(name);
        endfunction : new

        virtual function void build();
            this.default_map = create_map("reg_map", 0, 1, UVM_NO_ENDIAN);
            this.CTRL = new("CTRL");
            this.CTRL.configure(this);

            this.CTRL.build();
            this.default_map.add_reg(this.CTRL, 'h0);
            this.INTCTRL = new("INTCTRL");
            this.INTCTRL.configure(this);

            this.INTCTRL.build();
            this.default_map.add_reg(this.INTCTRL, 'h1);
            this.STATUS = new("STATUS");
            this.STATUS.configure(this);

            this.STATUS.build();
            this.default_map.add_reg(this.STATUS, 'h2);
            this.DATA = new("DATA");
            this.DATA.configure(this);

            this.DATA.build();
            this.default_map.add_reg(this.DATA, 'h3);
        endfunction : build
    endclass : atxmega_spi

endpackage: atxmega_spi_uvm_pkg
