Class: BlifUtils::AST::GenericLatch

Inherits:
Object
  • Object
show all
Defined in:
lib/blifutils/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, output, initValue: nil, ctrlType: nil, ctrlSig: nil) ⇒ GenericLatch

Returns a new instance of GenericLatch.



126
127
128
129
130
131
132
# File 'lib/blifutils/ast.rb', line 126

def initialize (input, output, initValue: nil, ctrlType: nil, ctrlSig: nil)
	@input = input
	@output = output
	@initValue = initValue
	@ctrlType = ctrlType
	@ctrlSig = ctrlSig
end

Instance Attribute Details

#ctrlSigObject (readonly)

Returns the value of attribute ctrlSig.



124
125
126
# File 'lib/blifutils/ast.rb', line 124

def ctrlSig
  @ctrlSig
end

#ctrlTypeObject (readonly)

Returns the value of attribute ctrlType.



124
125
126
# File 'lib/blifutils/ast.rb', line 124

def ctrlType
  @ctrlType
end

#initValueObject (readonly)

Returns the value of attribute initValue.



124
125
126
# File 'lib/blifutils/ast.rb', line 124

def initValue
  @initValue
end

#inputObject (readonly)

Returns the value of attribute input.



124
125
126
# File 'lib/blifutils/ast.rb', line 124

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



124
125
126
# File 'lib/blifutils/ast.rb', line 124

def output
  @output
end

Instance Method Details

#pretty_print(indent) ⇒ Object



134
135
136
137
138
139
140
141
142
# File 'lib/blifutils/ast.rb', line 134

def pretty_print (indent)
	str  = '    '*indent + "Latch:\n"
	str += '    '*(indent+1) + "Input:  \"#{@input}\"\n"
	str += '    '*(indent+1) + "Output: \"#{@output}\"\n"
	str += '    '*(indent+1) + "Initial value: #{@initValue.nil? ? "undefined" : "\"#{@initValue}\""}\n"
	str += '    '*(indent+1) + "Type: #{@ctrlType.nil? ? "undefined" : "\"#{@ctrlSig}\""}\n"
	str += '    '*(indent+1) + "Clock signal: #{@ctrlSig.nil? ? "undefined" : "\"#{@ctrlSig}\""}\n"
	return str
end