static void atoxi_fnt(int argc, char **argv) { int i; for(i=1;i<argc;i++) { uprintf("\"%s\"-->%u (0x%x)\r\n", argv[i],tinysh_atoxi(argv[i]),tinysh_atoxi(argv[i])); } }
void atoxi_fnt(int argc, char **argv) { int i; for(i=1;i<argc;i++) { MESSAGE("\"%s\"-->%u (0x%x)\n\r", argv[i],tinysh_atoxi(argv[i]),tinysh_atoxi(argv[i])); } }
void fifoput_cmd(int argc, char **argv) /* command = "fifoput" */ /* help = "puts a value in a fifo" */ /* params = "<fifo name> <value>" */ { Xuint32 value; char *name; int i; int fail = 0; if(argc!=3) { xil_printf("Wrong number of arguments\n\r"); return; } name = argv[1]; value = tinysh_atoxi(argv[2]); for(i=0;i<NUM_CORES;i++) if(strstart(name,cores[i].name)==FULLMATCH) { if(cores[i].type != xps_fifo) { xil_printf("Core '%s' is not a fifo\n\r",name); } else { if(strstart("in",cores[i].params)==FULLMATCH) { sif_fifo_write_nonblock(cores[i].address, value, &fail); if(fail) xil_printf("Operation failed. Fifo is full\n\r"); } else xil_printf("Fifo '%s' is not a 'From Processor' fifo and cannot accept data\n\r",name); } break; } if(i==NUM_CORES) xil_printf("Could not find core named '%s'\n\r",name); }
void fifoget_cmd(int argc, char **argv) /* command = "fifoget" */ /* help = "gets data from a fifo" */ /* params = "<fifo name> [<repeat>]" */ { char *name; int i,j; int fail; int repeat; Xuint32 value; if(argc!=2 && argc !=3) { xil_printf("Wrong number of arguments\n\r"); return; } name = argv[1]; for(i=0;i<NUM_CORES;i++) if(strstart(name,cores[i].name)==FULLMATCH) { if(cores[i].type != xps_fifo) { xil_printf("Core '%s' is not a fifo\n\r",name); } else { if(strstart("out",cores[i].params)==FULLMATCH) { if(argc==3) { repeat = tinysh_atoxi(argv[2]); for(j=0;j<repeat;j++) { value = sif_fifo_read_nonblock(cores[i].address, &fail); if(fail) xil_printf("0x%04X / %05d -> Operation failed. Fifo is empty\n\r", j, j); else { xil_printf("0x%04X / %05d -> 0x%08X / 0b%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d / %010d\n\r", j, j, value, (value>>31)&1, (value>>30)&1, (value>>29)&1, (value>>28)&1, (value>>27)&1, (value>>26)&1, (value>>25)&1, (value>>24)&1, (value>>23)&1, (value>>22)&1, (value>>21)&1, (value>>20)&1, (value>>19)&1, (value>>18)&1, (value>>17)&1, (value>>16)&1, (value>>15)&1, (value>>14)&1, (value>>13)&1, (value>>12)&1, (value>>11)&1, (value>>10)&1, (value>> 9)&1, (value>> 8)&1, (value>> 7)&1, (value>> 6)&1, (value>> 5)&1, (value>> 4)&1, (value>> 3)&1, (value>> 2)&1, (value>> 1)&1, (value>> 0)&1, value); } } } else { value = sif_fifo_read_nonblock(cores[i].address, &fail); if(fail) xil_printf("Operation failed. Fifo is empty\n\r"); else { xil_printf("0x%08X / 0b%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d / %010d\n\r", value, (value>>31)&1, (value>>30)&1, (value>>29)&1, (value>>28)&1, (value>>27)&1, (value>>26)&1, (value>>25)&1, (value>>24)&1, (value>>23)&1, (value>>22)&1, (value>>21)&1, (value>>20)&1, (value>>19)&1, (value>>18)&1, (value>>17)&1, (value>>16)&1, (value>>15)&1, (value>>14)&1, (value>>13)&1, (value>>12)&1, (value>>11)&1, (value>>10)&1, (value>> 9)&1, (value>> 8)&1, (value>> 7)&1, (value>> 6)&1, (value>> 5)&1, (value>> 4)&1, (value>> 3)&1, (value>> 2)&1, (value>> 1)&1, (value>> 0)&1, value); } } } else