Class: OrigenSVF::Tester
- Inherits:
-
Object
- Object
- OrigenSVF::Tester
- Includes:
- OrigenTesters::VectorBasedTester
- Defined in:
- lib/origen_svf/tester.rb
Instance Method Summary collapse
- #cycle(options = {}) ⇒ Object
- #delay(cycles, options = {}) ⇒ Object
-
#initialize ⇒ Tester
constructor
A new instance of Tester.
- #microcode(str) ⇒ Object
- #pattern_footer(options = {}) ⇒ Object
- #pattern_header(options = {}) ⇒ Object
- #read_dr(reg_or_val, options = {}) ⇒ Object
- #read_ir(reg_or_val, options = {}) ⇒ Object
- #set_timeset(name, period_in_ns) ⇒ Object
- #subdirectory ⇒ Object
- #write_dr(reg_or_val, options = {}) ⇒ Object
- #write_ir(reg_or_val, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Tester
Returns a new instance of Tester.
5 6 7 8 9 |
# File 'lib/origen_svf/tester.rb', line 5 def initialize @pat_extension = 'svf' @compress = false @comment_char = '//' end |
Instance Method Details
#cycle(options = {}) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/origen_svf/tester.rb', line 63 def cycle( = {}) v = '' ordered_pins.each do |pin| if pin.state == :dont_care if pin.direction == :output v += 'X' else v += 'Z' end elsif pin.state == :drive if pin.data == 0 v += 'L' else v += 'H' end elsif pin.state == :compare if pin.data == 0 v += 'D' else v += 'U' end else fail "Unknown pin state: #{pin.state}" end end microcode "PIO (#{v})" delay([:repeat]) if [:repeat] && [:repeat] > 1 end |
#delay(cycles, options = {}) ⇒ Object
40 41 42 |
# File 'lib/origen_svf/tester.rb', line 40 def delay(cycles, = {}) microcode "RUNTEST #{cycles} TCK;" end |
#microcode(str) ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/origen_svf/tester.rb', line 92 def microcode(str) if str.length > 80 str.scan(/.{1,80}/).each do |line| super(line) end else super end end |
#pattern_footer(options = {}) ⇒ Object
60 61 |
# File 'lib/origen_svf/tester.rb', line 60 def ( = {}) end |
#pattern_header(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/origen_svf/tester.rb', line 15 def pattern_header( = {}) microcode 'PIOMAP (' ordered_pins.each do |pin| if pin.direction == :input l = 'IN' elsif pin.direction == :output l = 'OUT' else l = 'INOUT' end microcode " #{l} #{pin.name.upcase}" end microcode ');' microcode '' microcode 'TRST ABSENT;' microcode 'ENDIR IDLE;' microcode 'ENDDR IDLE;' end |
#read_dr(reg_or_val, options = {}) ⇒ Object
56 57 58 |
# File 'lib/origen_svf/tester.rb', line 56 def read_dr(reg_or_val, = {}) microcode "SDR #{size(reg_or_val, )} TDO(#{data(reg_or_val)}) MASK(#{mask(reg_or_val, )});" end |
#read_ir(reg_or_val, options = {}) ⇒ Object
52 53 54 |
# File 'lib/origen_svf/tester.rb', line 52 def read_ir(reg_or_val, = {}) microcode "SIR #{size(reg_or_val, )} TDO(#{data(reg_or_val)}) MASK(#{mask(reg_or_val, )});" end |
#set_timeset(name, period_in_ns) ⇒ Object
34 35 36 37 38 |
# File 'lib/origen_svf/tester.rb', line 34 def set_timeset(name, period_in_ns) super f = (1 / (period_in_ns / 1_000_000_000.0)).ceil microcode "FREQUENCY #{f} HZ;" end |
#subdirectory ⇒ Object
11 12 13 |
# File 'lib/origen_svf/tester.rb', line 11 def subdirectory 'svf' end |
#write_dr(reg_or_val, options = {}) ⇒ Object
48 49 50 |
# File 'lib/origen_svf/tester.rb', line 48 def write_dr(reg_or_val, = {}) microcode "SDR #{size(reg_or_val, )} TDI(#{data(reg_or_val)});" end |
#write_ir(reg_or_val, options = {}) ⇒ Object
44 45 46 |
# File 'lib/origen_svf/tester.rb', line 44 def write_ir(reg_or_val, = {}) microcode "SIR #{size(reg_or_val, )} TDI(#{data(reg_or_val)});" end |