Automatically detect hardware and devices like FPGAs and SoCs, read/write to memory, program, compile, archive projects, generate LUT masks, perform timing analyses, and more.
For the following I will use two DE-10 Nano SoC FPGAs attached via USB. Note that function wrappers disrupt the automatically generated doc strings created by nbdev. As such, we will show the source code for details.
get_fpgas()
get_fpgas(parse=True) #strip the SoC
get_insts()
The dict is keyed by port, and valued by a list of lists. Each sublist gives a memory address. The first entry is the memory index, the second is the number of words, the third is the size of each word, the fourth is the RW behavior, the 5th is the type of memory, and the last is the name of the memory module.
read(inst=1,hw='DE-SoC [USB-1]',dev='@2: 5CSEBA6(.|ES)/5CSEMA6/.. (0x02D020DD)')
format_mem(0)
format_mem(10)
format_mem([0,1,2])
write(inst=1,data=[1,0,1])
read(inst=1)
read_write(args=[(1,'w',0,3),(1,'r')])
read_write(args=[(1,'w',[1,1,1]),(1,'r')])
read_write(args=[(1,'w',[1,1,1]),(1,'r')],reps=2)
read_write(args=[(1,'w',[1,1,1]),(1,'r'),(1,'w',0,3),(1,'r')])
read_write_all(fpgas=[('DE-SoC [USB-1]','@2: 5CSEBA6(.|ES)/5CSEMA6/.. (0x02D020DD)'),
('DE-SoC [USB-2]','@2: 5CSEBA6(.|ES)/5CSEMA6/.. (0x02D020DD)')],
args=[(1,'w',[1,1,1]),(1,'r'),(1,'w',0,3),(1,'r')])
lut_mask(lambda s:1 if s[0]==1 else 0)