Fix Invalid fpgconfig options in driver.py

The error info as follows by using opae version 1.1.2:

$fpgaconf -b 0x5e -d 0x00 -f 0x0 nlb_mode_0.gbs
Invalid cmdline options

fpgaconf Usage(case 1: initial version)
    fpgaconf [-hvn] [-b <bus>] [-d <device>] [-f <function>] [-s <socket>] <gbs>

fpgaconf Usage(case 2: for example opae version 1.1.2)
    fpgaconf [-hvn] [-B <bus>] [-D <device>] [-F <function>] [-S <socket-id>] <gbs>

so,change the command as follows:
    fpgaconf --bus 0x05 --device 0x00 --function 0x0 nlb_mode_0.gbs

Change-Id: Ibaf8f4c4abded6af7526e8cbed4e1578ed287160
This commit is contained in:
chenchunxiu 2019-03-29 07:26:58 +00:00
parent 0160a6b3bb
commit bb561521a2
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ class IntelFPGADriver(FPGADriver):
bdf = sysinfo.get_bdf_by_path(path)
bdfs = sysinfo.split_bdf(bdf)
cmd = ["sudo", "/usr/bin/fpgaconf"]
for i in zip(["-b", "-d", "-f"], bdfs):
for i in zip(["--bus", "--device", "--function"], bdfs):
cmd.extend(i)
cmd.append(image)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)

View File

@ -108,8 +108,8 @@ class TestIntelFPGADriver(base.TestCase):
b = "0x5e"
d = "0x00"
f = "0x0"
expect_cmd = ['sudo', '/usr/bin/fpgaconf', '-b', b,
'-d', d, '-f', f, '/path/image']
expect_cmd = ['sudo', '/usr/bin/fpgaconf', '--bus', b,
'--device', d, '--function', f, '/path/image']
mock_popen.return_value = p()
intel = IntelFPGADriver()
# program VF