fix uart selection when opening wishbone
This commit is contained in:
parent
1a07116ab1
commit
0bc1cd6f77
|
@ -23,13 +23,13 @@ class Uart2Wishbone:
|
||||||
self.uart.open()
|
self.uart.open()
|
||||||
self.uart.flushInput()
|
self.uart.flushInput()
|
||||||
try:
|
try:
|
||||||
wb.regs.uart2wb_sel.write(1)
|
self.regs.uart2wb_sel.write(1)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
try:
|
try:
|
||||||
wb.regs.uart2wb_sel.write(0)
|
self.regs.uart2wb_sel.write(0)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
self.uart.close()
|
self.uart.close()
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
import sys
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from miscope.std.misc import *
|
def dec2bin(d, nb=0):
|
||||||
|
if d=="x":
|
||||||
|
return "x"*nb
|
||||||
|
elif d==0:
|
||||||
|
b="0"
|
||||||
|
else:
|
||||||
|
b=""
|
||||||
|
while d!=0:
|
||||||
|
b="01"[d&1]+b
|
||||||
|
d=d>>1
|
||||||
|
return b.zfill(nb)
|
||||||
|
|
||||||
def get_bits(values, width, low, high=None):
|
def get_bits(values, width, low, high=None):
|
||||||
r = []
|
r = []
|
||||||
|
|
Loading…
Reference in New Issue