Class: OrigenTesters::Test::NVM

Inherits:
Object
  • Object
show all
Includes:
Origen::Pins, Origen::Registers
Defined in:
lib/origen_testers/test/nvm.rb

Direct Known Subclasses

NVMSub

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNVM

Returns a new instance of NVM.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/origen_testers/test/nvm.rb', line 9

def initialize
  add_reg :mclkdiv,   0x03,  16,  osch:    { pos: 15 },
                                  asel:    { pos: 14 },
                                  failctl: { pos: 13 },
                                  parsel:  { pos: 12 },
                                  eccen:   { pos: 11 },
                                  cmdloc:  { pos: 8, bits: 3, res: 0b001 },
                                  clkdiv:  { pos: 0, bits: 8, res: 0x18 }

  add_reg :data,      0x4,   16,  d: { pos: 0, bits: 16 }

  @blocks = [Block.new(0, self), Block.new(1, self), Block.new(2, self)]
end

Instance Attribute Details

#blocksObject

Returns the value of attribute blocks.



4
5
6
# File 'lib/origen_testers/test/nvm.rb', line 4

def blocks
  @blocks
end

Instance Method Details

#add_proth_regObject



39
40
41
42
43
44
45
46
# File 'lib/origen_testers/test/nvm.rb', line 39

def add_proth_reg
  reg :proth, 0x0024, size: 32 do
    bits 31..24,   :fprot7,  reset: 0xFF
    bits 23..16,   :fprot6,  reset: 0xEE
    bits 15..8,    :fprot5,  reset: 0xDD
    bits 7..0,     :fprot4,  reset: 0x11
  end
end

#added_methodObject



35
36
37
# File 'lib/origen_testers/test/nvm.rb', line 35

def added_method
  :added
end

#find_block_by_id(id) ⇒ Object



23
24
25
# File 'lib/origen_testers/test/nvm.rb', line 23

def find_block_by_id(id)
  @blocks.find { |block| block.id == id }
end

#override_methodObject



31
32
33
# File 'lib/origen_testers/test/nvm.rb', line 31

def override_method
  :overridden
end

#reg_owner_aliasObject



27
28
29
# File 'lib/origen_testers/test/nvm.rb', line 27

def reg_owner_alias
  %w(flash fmu)
end