yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
txt2tikztiming Namespace Reference

Functions

def value_to_logic
 
def value_to_binary
 
def value_to_hex
 
def value_to_decimal
 

Variables

tuple parser = argparse.ArgumentParser(description='Convert vcd2txt output to tikz-timing line.')
 
tuple args = parser.parse_args()
 
 start_time = None
 
 stop_time = None
 
dictionary time_val = { }
 
tuple time = int(time)
 
 last_time = None
 
 last_value = None
 

Function Documentation

def txt2tikztiming.value_to_binary (   value)

Definition at line 33 of file txt2tikztiming.py.

33 
34 def value_to_binary(value):
35  return "D{%s}" % value
def txt2tikztiming.value_to_decimal (   value)

Definition at line 61 of file txt2tikztiming.py.

61 
62 def value_to_decimal(value):
63  val = 0
64  found_def = False
65  found_undef = False
66  for digit in value:
67  if digit == 'x':
68  found_undef = True
69  else:
70  val = val*2 + int(digit)
71  found_def = True
72  if found_def:
73  if found_undef:
74  return "D{X}"
75  else:
76  return "D{%d}" % val
77  return "U"
def txt2tikztiming.value_to_hex (   value)

Definition at line 36 of file txt2tikztiming.py.

36 
37 def value_to_hex(value):
38  hex_string = ""
39  found_def = False
40  while len(value) % 4 != 0:
41  value = "0" + value
42  while len(value) != 0:
43  bin_digits = value[0:4]
44  hex_digit = 0
45  value = value[4:]
46  for b in bin_digits:
47  if b == '0':
48  hex_digit = hex_digit * 2
49  elif b == '1':
50  hex_digit = hex_digit * 2 + 1
51  else:
52  hex_digit += 100
53  if hex_digit > 15:
54  hex_string += "x"
55  else:
56  found_def = True
57  hex_string += "0123456789abcdef"[hex_digit]
58  if not found_def:
59  return "U";
60  return "D{%s}" % hex_string
def txt2tikztiming.value_to_logic (   value)

Definition at line 24 of file txt2tikztiming.py.

24 
25 def value_to_logic(value):
26  found_x = False
27  for char in value:
28  if char == '1':
29  return "H"
30  if char == 'x':
31  found_x = True
32  return "U" if found_x else "L"

Variable Documentation

tuple txt2tikztiming.args = parser.parse_args()

Definition at line 18 of file txt2tikztiming.py.

txt2tikztiming.last_time = None

Definition at line 100 of file txt2tikztiming.py.

txt2tikztiming.last_value = None

Definition at line 101 of file txt2tikztiming.py.

tuple txt2tikztiming.parser = argparse.ArgumentParser(description='Convert vcd2txt output to tikz-timing line.')

Definition at line 10 of file txt2tikztiming.py.

txt2tikztiming.start_time = None

Definition at line 20 of file txt2tikztiming.py.

txt2tikztiming.stop_time = None

Definition at line 21 of file txt2tikztiming.py.

tuple txt2tikztiming.time = int(time)

Definition at line 80 of file txt2tikztiming.py.

dictionary txt2tikztiming.time_val = { }

Definition at line 22 of file txt2tikztiming.py.