📄 host_cmd.txt
字号:
iix=iix+1; comstr[iix]= "025 ATTAC 0"; //Optional. Making 80xx cpu has
. //enough time to program the test
. //mode register before FUSB200
. //attachs the Host.
.
iix=iix+1; comstr[iix]= "025 ATTAC 0"; //Optional. Making 80xx cpu has
//enough time to program the test
//mode register before FUSB200
//attachs the Host.
iix=iix+1; comstr[iix]= "020 ATTAC 1"; //Delay 20 12-MHz clock cycles,then,
//device attaches host.
iix=iix+1; comstr[iix]= "020 RESET"; //Delay 20 12-MHz clock cycles,then,
//send USB reset to downstream port.
iix=iix+1; comstr[iix]= "045 SETUP 00 0";
iix=iix+1; comstr[iix]= "000 DATA0 00 SETA 0055 0000 0000"; //set address
//to 55H.
iix=iix+1; comstr[iix]= "000 WAIT ACK -2"; //wait until ACK otherwise repeat
//last 2 commands.
iix=iix+1; comstr[iix]= "000 WAIT t036250"; // Optional. Wait 36250 12MHz
//clock cycle to let CPU has
//enough time to initiate the
//FUSB200 registers.
//Don't wait over 60 12MHz
//clock cycles (5us) in test
//mode. Don't wait over 36250
//12MHz clock cycles (2.9 ms)
//in normal mode.
//Else, It will enter suspend
//mode.
iix=iix+1; comstr[iix]= "025 SOF 12 3"; //Optional. Send SOF command to
. //delay the next command. It lets
. //CPU has enough time to initiate
. //the FUSB200 registers.
. //Don't use any number bigger
. //than 060 in test mode.
iix=iix+1; comstr[iix]= "000 WAIT t036250"; // Optional. Wait 36250 12MHz
//clock cycle to let CPU has
//enough time to initiate the
//FUSB200 registers.
ix=iix+1; comstr[iix]= "025 SOF 12 3"; //Optional. Send SOF command to
//delay the next command. It lets
//CPU has enough time to initiate
//the FUSB200 registers.
iix=iix+1; comstr[iix]= "000 IN 00 0";
iix=iix+1; comstr[iix]= "000 WAIT ACK -1"; //wait until ACK otherwise
//repeat last command
iix=iix+1; comstr[iix]= "000 ACK "; //Host send ACK.
If users want to run patterns in HIGH SPEED mode,
users must "`define high_speed" and comment out "`define full_speed" in this host
model. And add these lines below at the beginning of your patterns.
iix=iix+1; comstr[iix]= "999 ATTAC 0"; //Optional. Making 80xx cpu has
. //enough time to program the test
. //mode registers before FUSB200
. //attachs the Host.
.
iix=iix+1; comstr[iix]= "999 ATTAC 0"; //Optional. Making 80xx cpu has
. //enough time to program the test
. //mode register before FUSB200
. //attachs the Host.
iix=iix+1; comstr[iix]= "999 ATTAC 1"; //Delay 999 480-MHz clock cycles,then,
//device attaches host.
iix=iix+1; comstr[iix]= "999 RESET"; //Delay 999 480-MHz clock cycles,then,
//send USB reset to downstream port.
iix=iix+1; comstr[iix]= "000 WAIT t194000"; //Optional. Wait 194000 480MHz
//clock cycles to let CPU has
//enough time to initiate the
//FUSB200 registers.
//Don't wait over 1000 480MHz
//clock cycles (2 us) in test
//mode.
//The device will enter suspend
//mode in simulation.
iix=iix+1; comstr[iix]= "999 SOF 12 3"; //Optional. Send SOF command to
//delay the next command.
. //It lets CPU has enough time
. //to initiate the FUSB200
//registers.
iix=iix+1; comstr[iix]= "000 WAIT t194000"; //Optional. Wait 194000 480MHz
//clock cycles to let CPU has
//enough time to initiate the
//FUSB200 registers.
//Don't wait over 1000 480MHz
//clock cycles (2 us) in test
//mode.
//The device will enter suspend
//mode in simulation.
ix=iix+1; comstr[iix]= "999 SOF 12 3"; //Optional. Send SOF command to
//delay the next command. It lets
//CPU has enough time to initiate
//the FUSB200 registers.
iix=iix+1; comstr[iix]= "045 SETUP 00 0";
iix=iix+1; comstr[iix]= "000 DATA0 00 SETA 0055 0000 0000";
iix=iix+1; comstr[iix]= "000 WAIT ACK -2";
iix=iix+1; comstr[iix]= "000 IN 00 0";
iix=iix+1; comstr[iix]= "000 WAIT ACK -1";
iix=iix+1; comstr[iix]= "000 ACK ";
2. Commands Format
delay + PID + address + endp#
|
+--> SETUP, IN, OUT, SOF
delay + PID + data
|
+--> DATA0, DATA1
==> 000 SETUP 00 0
==> 000 IN 55 1
==> 000 OUT 55 2
==> 000 PING 55 3
==> 000 DATA1 12 34 56 78 90 11 22 33. //NOTICE : THE MAX. PACKET SIZE IS 8
//BYTES. If users wnat to
//send lareger packet, please use
//"000 DATA0 buffer0" or
//"000 DATA0 12 x1023".
==> 000 DATA0 12 34 56 78 90 AB. //"." is for ending
==> 000 DATA0 00 SETA 0000 0000 0000 //set address
GETS //get status
SYNF //synch-frame
SETF //set feature
CLRF //clear feature
GETC //get configuration
SETC //set configuration
GETD //get descriptor
SETD //set descriptor
GETI //get interface
SETI //set interface
COM? //Vendor Command, and ?=0~F
==> 000 WAIT 1 //wait for 1 packet
==> 000 WAIT ACK -1 //wait until ACK otherwise repeat
//last command
==> 000 WAIT ACK -2 //wait until ACK otherwise repeat
//last 2commands
==> 000 WAIT ACK -3 //wait until ACK otherwise repeat
//last 3 commands
==> 000 SOF 12 3 //SOF, frame # is 123.
==> 000 WAIT_SOF //wait until 1ms and assert SOF
==> 000 SOF PERIOD=12000 //to change Frame Cycle period
==> 000 ACK //Host sends ACK if no error
==> 000 PRE //preamble packet
==> 000 ***** this is a just comment //comments
==> 000xACK //send a bad ACK
==> 000cDATA0 12 34 56 78 90 AB. //send error CRC16
==> 000nDATA0 12 34 56 78 90 AB. //without sending CRC16
==> 000bDATA0 12 34 56 78 90 AB. //without sending stuffed bit
==> 000xDATA0 12 34 56 78 90 AB. //DATA pid error
==> 000 DATA0 12 x1023 //send 1023 bytes data starting from
//12H. The data are
//12H 13H 14.....410H.
==> 000 DATA0 12 34 10 x0034 //send 12 34 10 and 34 bytes starting
//from 10H
==> 000 DATA0 buffer0 //send data from "buffer0.in". About
// the file format,
//please reference to the sample file
//"buffer0.in".
==> 000 DATA0 buffer1 //send data from "buffer1.in". The
// same format as buffer0.in.
//If users want to use more
//buffer#.in, just search "buffer0"
//in this host model and follow the
//same logic to modify
//that part.
//Then users can use the command
//"000 DATA0 buffer2",
//"000 DATA0 buffer3",.... .etc.
==> 000 RESET 0 //send USB reset to downstream port
//(For USB controller internal use
//only. IT IS NOT PROVIDED TO
//CUSTOMERS)
==> 000 RESET 1 //send USB reset to downstream port
==> 000 RESET //the same as "000 RESET 1"
==> 000 RESUM 0 //send Resume Signal. Host will wait
//the k state, then issue resume.
==> 000 RESUM 1 //send Resume Signal. Host will
// issue resume immediatelly.
==> 000 RESUM 2 //send Resume Signal. Host issues
//resume when the J state
//appears.
==> 000 WAKEUP //send WAKEUP Signal
==> 000 TSTPK //turn off timeout issue for host
//when test packet (For USB
//controller internal test mode use,
// IT IS NOT PROVIDED TO CUSTOMERS).
==> 000 ATTAC 1 //device attach
==> 000 ATTAC 0 //device detach
==> 000 SUSPD //enter real time counting
==> 000 JUMPER 1111 //general purpose output from host
//model(usb.in)
//(For USB controller internal test
//mode use, IT IS NOT PROVIDED TO
//CUSTOMERS).
==> 000 UNPLUG //Remote USB RESET (For USB
//controller internal test use only,
//IT IS NOT PROVIDED TO CUSTOMERS).
==> 000 TSTJK //Test J/K (For USB controller
//internal test use only,
// IT IS NOT PROVIDED TO CUSTOMERS).
==> 000 HWRST //Hardware Reset (For USB controller
//internal test use only,
// IT IS NOT PROVIDED TO CUSTOMERS).
3. Pattern example
Please reference to the pattern samples and buffer0.in. Users need to keep the same space as the space
in the samples. Else, the host model can't under the pattern.
iix=iix+1; comstr[iix]= "000 WAIT ACK -2"; //correct
iix=iix+1; comstr[iix]= "000 WAIT ACK -2"; //incorrect. Space between
//WAIT and ACK is not correct.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -