ENTRY &file_name PRINT "&file_name" GOSUB DATA_INIT "ps7_mio_init_data_1_0" GOSUB DATA_INIT "ps7_pll_init_data_1_0" GOSUB DATA_INIT "ps7_clock_init_data_1_0" GOSUB DATA_INIT "ps7_ddr_init_data_1_0" GOSUB DATA_INIT "ps7_peripherals_init_data_1_0" ENDDO DATA_INIT: ENTRY &function_name PRINT "&function_name" OPEN #1 &file_name /Read READ #1 %line &myline WHILE !FILE.EOF(1) ( IF STRing.SCAN("&myline","proc",0)!=-1 ( IF STRing.SCAN("&myline",&function_name,0)!=-1 ( PRINT "&myline" READ #1 %line &myline WHILE STRing.SCAN("&myline","}",0)==-1 ( PRINT "&myline" IF STRing.SCAN("&myline","mask_write",0)!=-1 ( &myline=STRING.LOWER("&myline") &index=STRING.SCAN("&myline","0x",0) &address=STRING.MID("&myline",&index,10.) &index=STRING.SCAN("&myline","0x",&index+2) &mask=STRING.MID("&myline",&index,10.) &index=STRING.SCAN("&myline","0x",&index+2) &value=STRING.MID("&myline",&index,10.) GOSUB MASK_WRITE &address &mask &value ) IF STRing.SCAN("&myline","mask_poll",0)!=-1 ( &myline=STRING.LOWER("&myline") &index=STRING.SCAN("&myline","0x",0) &address=STRING.MID("&myline",&index,10.) &index=STRING.SCAN("&myline","0x",&index+2) &value=STRING.MID("&myline",&index,10.) GOSUB MASK_POLL &address &value ) READ #1 %line &myline ) ) ) READ #1 %line &myline ) CLOSE #1 RETURN MASK_WRITE: LOCAL &read &write ENTRY &address &mask &value &read=DATA.LONG(ZSD:&address) &write=(&read&~&mask)|(&value&&mask) DATA.SET ZSD:&address %LONG &write PRINT "&address" PRINT "&write" RETURN MASK_POLL: LOCAL &read &match ENTRY &address &value &read=DATA.LONG(ZSD:&address) &match=&read&&value PRINT "&read" PRINT "&value" PRINT "&match" WHILE &match==0 ( &read=DATA.LONG(ZSD:&address) &match=&read&&value ) RETURN