3232 help = "UDP port of board (default: 27181)" , type = "int" , default = 27181 )
3333parser .add_option ("-t" , "--timeout" , dest = "timeout" ,
3434 help = "Response timeout in seconds (default: 0.2)" , type = "float" , default = .2 )
35- parser .add_option ("-s" , "--space" , dest = "space" , default = None ,
35+ parser .add_option ("-s" , "--space" , dest = "space" , default = 0 ,
3636 choices = ["0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" ],
37- help = "Address space to read or write" )
37+ help = "Address space to read or write (default: 0, the hm2 register file) " )
3838parser .add_option ("--info" , dest = "info" , action = "store_true" ,
3939 default = False ,
4040 help = "Select info area for read operation (default: memory space)" )
@@ -109,7 +109,6 @@ def optimal_size(space, info, address, nbytes):
109109 raise ValueError ("Access size incompatible with address or length (address=%d nbytes=%d memsizes=%d)" % (address , nbytes , memsizes ))
110110
111111if options .read :
112- if options .space is None : raise SystemExit ("--read must specify --space" )
113112 if options .address is None : raise SystemExit ("--read must specify --address" )
114113 size = optimal_size (options .space , options .info , options .address , options .read if options .increment else 0 )
115114 command = make_read_request (options .space , options .info , size , options .increment , options .address , options .read )
@@ -118,7 +117,6 @@ def optimal_size(space, info, address, nbytes):
118117 transact (command )
119118
120119elif options .write :
121- if options .space is None : raise SystemExit ("--write must specify --space" )
122120 if options .address is None : raise SystemExit ("--write must specify --address" )
123121 write = options .write .decode ("hex" )
124122 size = optimal_size (options .space , options .info , options .address , len (write ) if options .increment else 0 )
0 commit comments