Class: OrigenJTAGDev::DUT
- Inherits:
-
Object
- Object
- OrigenJTAGDev::DUT
- Includes:
- Origen::TopLevel, OrigenJTAG
- Defined in:
- lib/origen_jtag_dev/top_level.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.
Constant Summary collapse
- JTAG_CONFIG =
{ verbose: true, tclk_format: :rh, tclk_multiple: 1, tdo_strobe: :tclk_high, tdo_store_cycle: 0, init_state: :unknown }
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 = {}) ⇒ DUT
constructor
A new instance of DUT.
- #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.
-
#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 duing gem testing.
Methods included from OrigenJTAG
Constructor Details
#initialize(options = {}) ⇒ DUT
Returns a new instance of DUT.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/origen_jtag_dev/top_level.rb', line 22 def initialize( = {}) 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] instantiate_registers() instantiate_pins() end |
Instance Attribute Details
#jtag_config ⇒ Object (readonly)
Returns the value of attribute jtag_config.
11 12 13 |
# File 'lib/origen_jtag_dev/top_level.rb', line 11 def jtag_config @jtag_config end |
Instance Method Details
#init_state ⇒ Object
Getter for top-level init_state setting
81 82 83 |
# File 'lib/origen_jtag_dev/top_level.rb', line 81 def init_state JTAG_CONFIG[:init_state] end |
#instantiate_pins(options = {}) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/origen_jtag_dev/top_level.rb', line 49 def instantiate_pins( = {}) add_pin :tclk add_pin :tdi add_pin :tdo add_pin :tms end |
#instantiate_registers(options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/origen_jtag_dev/top_level.rb', line 33 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
56 57 58 |
# File 'lib/origen_jtag_dev/top_level.rb', line 56 def startup( = {}) tester.set_timeset('nvmbist', 40) end |
#tclk_format ⇒ Object
Getter for top-level tclk_format setting
61 62 63 |
# File 'lib/origen_jtag_dev/top_level.rb', line 61 def tclk_format JTAG_CONFIG[:tclk_format] end |
#tclk_multiple ⇒ Object
Getter for top-level tclk_multiple setting
66 67 68 |
# File 'lib/origen_jtag_dev/top_level.rb', line 66 def tclk_multiple JTAG_CONFIG[:tclk_multiple] end |
#tdo_store_cycle ⇒ Object
Getter for top-level tdo_store_cycle setting
76 77 78 |
# File 'lib/origen_jtag_dev/top_level.rb', line 76 def tdo_store_cycle JTAG_CONFIG[:tdo_store_cycle] end |
#tdo_strobe ⇒ Object
Getter for top-level tdo_strobe setting
71 72 73 |
# File 'lib/origen_jtag_dev/top_level.rb', line 71 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 duing gem testing
86 87 88 89 90 91 92 |
# File 'lib/origen_jtag_dev/top_level.rb', line 86 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 |