Class: OrigenJTAGDev::NewStyle
- Inherits:
-
Object
- Object
- OrigenJTAGDev::NewStyle
- Includes:
- Origen::TopLevel
- Defined in:
- lib/origen_jtag_dev/new_style.rb
Overview
This is a dummy DUT model which is used to instantiate and test the JTAG locally during development.
It is not included when this library is imported.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#jtag_config ⇒ Object
readonly
Returns the value of attribute jtag_config.
Instance Method Summary collapse
-
#init_state ⇒ Object
Getter for top-level init_state setting.
-
#initialize(options = {}) ⇒ NewStyle
constructor
A new instance of NewStyle.
- #instantiate_pins(options = {}) ⇒ Object
- #instantiate_registers(options = {}) ⇒ Object
- #startup(options = {}) ⇒ Object
-
#tclk_format ⇒ Object
Getter for top-level tclk_format setting.
-
#tclk_multiple ⇒ Object
Getter for top-level tclk_multiple setting.
-
#tclk_vals ⇒ Object
Getter for top-level tclk_vals setting.
-
#tdo_store_cycle ⇒ Object
Getter for top-level tdo_store_cycle setting.
-
#tdo_strobe ⇒ Object
Getter for top-level tdo_strobe setting.
-
#update_jtag_config(cfg, val) ⇒ Object
Wouldn't want to do this in reality, but allows some flexibility during gem testing.
Constructor Details
#initialize(options = {}) ⇒ NewStyle
Returns a new instance of NewStyle.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/origen_jtag_dev/new_style.rb', line 12 def initialize( = {}) @jtag_config = { verbose: true, tclk_format: :rh, tclk_multiple: 1, tdo_strobe: :tclk_high, tdo_store_cycle: 0, init_state: :unknown } @jtag_config[:tclk_format] = [:tclk_format] if [:tclk_format] @jtag_config[:tclk_multiple] = [:tclk_multiple] if [:tclk_multiple] @jtag_config[:tdo_strobe] = [:tdo_strobe] if [:tdo_strobe] @jtag_config[:tdo_store_cycle] = [:tdo_store_cycle] if [:tdo_store_cycle] @jtag_config[:init_state] = [:init_state] if [:init_state] @jtag_config[:tclk_vals] = [:tclk_vals] if [:tclk_vals] @jtag_config[:cycle_callback] = [:cycle_callback] if [:cycle_callback] instantiate_registers() instantiate_pins() sub_block :jtag, { class_name: 'OrigenJTAG::Driver' }.merge(@jtag_config) if [:extra_port] # Test supplying both pin IDs (recommended) and pin objects (legacy) sub_block :jtag2, { class_name: 'OrigenJTAG::Driver', tck_pin: :tck_2, tdi_pin: :tdi_2, tdo_pin: pin(:tdo_2), tms_pin: pin(:tms_2) }.merge(@jtag_config) end end |
Instance Attribute Details
#jtag_config ⇒ Object (readonly)
Returns the value of attribute jtag_config.
10 11 12 |
# File 'lib/origen_jtag_dev/new_style.rb', line 10 def jtag_config @jtag_config end |
Instance Method Details
#init_state ⇒ Object
Getter for top-level init_state setting
100 101 102 |
# File 'lib/origen_jtag_dev/new_style.rb', line 100 def init_state @jtag_config[:init_state] end |
#instantiate_pins(options = {}) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/origen_jtag_dev/new_style.rb', line 54 def instantiate_pins( = {}) add_pin :tclk unless [:invalid_pins] add_pin :tdi end add_pin :tdo add_pin :tms if [:extra_port] add_pin :tck_2 add_pin :tdi_2 add_pin :tdo_2 add_pin :tms_2 end end |
#instantiate_registers(options = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/origen_jtag_dev/new_style.rb', line 38 def instantiate_registers( = {}) reg :test16, 0x0012, size: 16 do |reg| reg.bit 15..8, :bus reg.bit 0, :bit end reg :test32, 0x0014, size: 32 do |reg| reg.bit 31..16, :bus reg.bit 0, :bit end reg :full16, 0x0012, size: 16 do |reg| reg.bit 15..0, :data end end |
#startup(options = {}) ⇒ Object
70 71 72 |
# File 'lib/origen_jtag_dev/new_style.rb', line 70 def startup( = {}) tester.set_timeset('nvmbist', 40) end |
#tclk_format ⇒ Object
Getter for top-level tclk_format setting
75 76 77 |
# File 'lib/origen_jtag_dev/new_style.rb', line 75 def tclk_format @jtag_config[:tclk_format] end |
#tclk_multiple ⇒ Object
Getter for top-level tclk_multiple setting
80 81 82 |
# File 'lib/origen_jtag_dev/new_style.rb', line 80 def tclk_multiple @jtag_config[:tclk_multiple] end |
#tclk_vals ⇒ Object
Getter for top-level tclk_vals setting
85 86 87 |
# File 'lib/origen_jtag_dev/new_style.rb', line 85 def tclk_vals @jtag_config[:tclk_vals] end |
#tdo_store_cycle ⇒ Object
Getter for top-level tdo_store_cycle setting
95 96 97 |
# File 'lib/origen_jtag_dev/new_style.rb', line 95 def tdo_store_cycle @jtag_config[:tdo_store_cycle] end |
#tdo_strobe ⇒ Object
Getter for top-level tdo_strobe setting
90 91 92 |
# File 'lib/origen_jtag_dev/new_style.rb', line 90 def tdo_strobe @jtag_config[:tdo_strobe] end |
#update_jtag_config(cfg, val) ⇒ Object
Wouldn't want to do this in reality, but allows some flexibility during gem testing
105 106 107 108 109 110 111 |
# File 'lib/origen_jtag_dev/new_style.rb', line 105 def update_jtag_config(cfg, val) if @jtag_config.key?(cfg) @jtag_config[cfg] = val else fail "#{cfg} not a part of @jtag_config" end end |