/** * bus->driver->(*init) * */ static int jopcyc_bus_init( bus_t *bus ) { part_t *p = PART; chain_t *chain = CHAIN; component_t *comp; if (tap_state(chain) != Run_Test_Idle) { /* silently skip initialization if TAP isn't in RUNTEST/IDLE state this is required to avoid interfering with detect when initbus is contained in the part description file bus_init() will be called latest by bus_prepare() */ return URJTAG_STATUS_OK; } /* Preload update registers See AN039, "Guidelines for IEEE Std. 1149.1 Boundary Scan Testing */ part_set_instruction( p, "SAMPLE/PRELOAD" ); chain_shift_instructions( chain ); /* RAMA */ comp = COMP_RAMA; set_data_in( bus, comp ); part_set_signal( p, nCS, 1, 1 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 1 ); part_set_signal( p, nLB, 1, 1 ); part_set_signal( p, nUB, 1, 1 ); /* RAMB */ comp = COMP_RAMB; set_data_in( bus, comp ); part_set_signal( p, nCS, 1, 1 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 1 ); part_set_signal( p, nLB, 1, 1 ); part_set_signal( p, nUB, 1, 1 ); /* FLASH */ comp = COMP_FLASH; set_data_in( bus, comp ); part_set_signal( p, nCS, 1, 1 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 1 ); part_set_signal( p, nCS2, 1, 1 ); part_set_signal( p, nRDY, 0, 0 ); /* Serial Port */ part_set_signal( p, SER_RXD, 0, 0 ); part_set_signal( p, SER_NRTS, 1, 1 ); part_set_signal( p, SER_TXD, 1, 1 ); part_set_signal( p, SER_NCTS, 0, 0 ); chain_shift_data_registers( chain, 0 ); INITIALIZED = 1; return URJTAG_STATUS_OK; }
/** * bus->driver->(*read_start) * */ static void jopcyc_bus_read_start( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; bus_area_t area; component_t *comp; comp_bus_area( bus, adr, &area, &comp ); if (!comp) { printf( _("Address out of range\n") ); LAST_ADDR = adr; return; } part_set_signal( p, nCS, 1, 0 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 0 ); if (comp->ctype == RAM) { part_set_signal( p, nLB, 1, 0 ); part_set_signal( p, nUB, 1, 0 ); } setup_address( bus, adr, comp ); set_data_in( bus, comp ); chain_shift_data_registers( chain, 0 ); }
/** * bus->driver->(*read_start) * */ static void sh7750r_bus_read_start( bus_t *bus, uint32_t adr ) { part_t *p = PART; int cs[8]; int i; for (i = 0; i < 8; i++) cs[i] = 1; cs[(adr & 0x1C000000) >> 26] = 0; part_set_signal( p, CS[0], 1, cs[0] ); part_set_signal( p, CS[1], 1, cs[1] ); part_set_signal( p, CS[2], 1, cs[2] ); part_set_signal( p, CS[3], 1, cs[3] ); part_set_signal( p, CS[4], 1, cs[4] ); part_set_signal( p, CS[5], 1, cs[5] ); part_set_signal( p, CS[6], 1, cs[6] ); part_set_signal( p, RDWR, 1, 1 ); part_set_signal( p, RDWR2, 1, 1 ); part_set_signal( p, WE[0], 1, 1 ); part_set_signal( p, WE[1], 1, 1 ); part_set_signal( p, WE[2], 1, 1 ); part_set_signal( p, WE[3], 1, 1 ); part_set_signal( p, RD, 1, 0 ); part_set_signal( p, RD2, 1, 0 ); setup_address( bus, adr ); set_data_in( bus ); chain_shift_data_registers( CHAIN, 0 ); }
/** * bus->driver->(*read_start) * */ static void s3c4510_bus_read_start( bus_t *bus, uint32_t adr ) { /* see Figure 4-19 in [1] */ chain_t *chain = CHAIN; s3c4510_bus_setup_ctrl( bus, 0x00fffe); /* nOE=0, nRCS0 =0 */ setup_address( bus, adr ); set_data_in( bus ); chain_shift_data_registers( chain, 0 ); }
static void ppc440gx_ebc8_bus_read_start( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; part_set_signal( p, nCS, 1, 0 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 0 ); setup_address( bus, adr ); set_data_in( bus ); chain_shift_data_registers( chain, 0 ); }
/** * bus->driver->(*read_start) * */ static void bf533_ezkit_bus_read_start( bus_t *bus, uint32_t adr ) { part_t *p = PART; chain_t *chain = CHAIN; select_flash( bus ); part_set_signal( p, AOE, 1, 0 ); part_set_signal( p, AWE, 1, 1 ); setup_address( bus, adr ); set_data_in( bus ); chain_shift_data_registers( chain, 0 ); }
int main(void){ static float data_out [DATA_LEN] ; static float data_in [DATA_LEN] ; /* Do safest and most used sample rates first. */ int sample_rates [] = { 44100, 48000, 32000, 22050, 16000, 96000 } ; unsigned k ; int errors = 0 ; int ch; gen_windowed_sine (data_out, ARRAY_LEN (data_out), 0.95); for(ch=1;ch<=8;ch++){ float q=-.05; printf("\nTesting %d channel%s\n\n",ch,ch==1?"":"s"); while(q<1.){ for (k = 0 ; k < ARRAY_LEN (sample_rates); k ++) { char filename [64] ; snprintf (filename, sizeof (filename), "vorbis_%dch_q%.1f_%u.ogg", ch,q*10,sample_rates [k]); printf (" %-20s : ", filename); fflush (stdout); /* Set to know value. */ set_data_in (data_in, ARRAY_LEN (data_in), 3.141); write_vorbis_data_or_die (filename, sample_rates [k], q, data_out, ARRAY_LEN (data_out),ch); read_vorbis_data_or_die (filename, sample_rates [k], data_in, ARRAY_LEN (data_in)); if (check_output (data_in, ARRAY_LEN (data_in), (.15f - .1f*q)) != 0) errors ++ ; else { puts ("ok"); remove (filename); } } q+=.1; } } if (errors) exit (1); printf("ALL OK\n"); return 0; }
/** * bus->driver->(*read_next) * */ static uint32_t s3c4510_bus_read_next( bus_t *bus, uint32_t adr ) { /* see Figure 4-20 in [1] */ part_t *p = PART; chain_t *chain = CHAIN; int i; uint32_t d = 0; s3c4510_bus_setup_ctrl( bus, 0x00fffe); /* nOE=0, nRCS0 =0 */ setup_address( bus, adr ); set_data_in( bus ); chain_shift_data_registers( chain, 1 ); for (i = 0; i < dbus_width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; }
/** * bus->driver->(*read_start) * */ static void sharc_21065L_bus_read_start( bus_t *bus, uint32_t adr ) { chain_t *chain = CHAIN; part_t *p = PART; LAST_ADR = adr; if (adr >= 0x080000) return; part_set_signal( p, BMS, 1, 0 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nOE, 1, 0 ); setup_address( bus, adr ); set_data_in( bus, adr ); chain_shift_data_registers( chain, 0 ); }
void sa1110_bus_read_start( parts *ps, uint32_t adr ) { /* see Figure 10-12 in SA doc */ part *p = ps->parts[0]; part_set_signal( p, "nCS0", 1, 0 ); part_set_signal( p, "nCS1", 1, 1 ); part_set_signal( p, "nCS2", 1, 1 ); part_set_signal( p, "nCS3", 1, 1 ); part_set_signal( p, "nCS4", 1, 1 ); part_set_signal( p, "nCS5", 1, 1 ); part_set_signal( p, "RD_nWR", 1, 1 ); part_set_signal( p, "nWE", 1, 1 ); part_set_signal( p, "nOE", 1, 0 ); setup_address( p, adr ); set_data_in( p ); parts_shift_data_registers( ps ); }
int main(void){ static float data_out [DATA_LEN] ; static float data_in [DATA_LEN] ; /* Do safest and most used sample rates first. */ int sample_rates [] = { 44100, 48000, 32000, 22050, 16000, 96000 } ; unsigned k ; int errors = 0 ; gen_windowed_sine (data_out, ARRAY_LEN (data_out), 0.95); for (k = 0 ; k < ARRAY_LEN (sample_rates); k ++) { char filename [64] ; snprintf (filename, sizeof (filename), "vorbis_%u.ogg", sample_rates [k]); printf (" %-20s : ", filename); fflush (stdout); /* Set to know value. */ set_data_in (data_in, ARRAY_LEN (data_in), 3.141); write_vorbis_data_or_die (filename, sample_rates [k], data_out, ARRAY_LEN (data_out)); read_vorbis_data_or_die (filename, sample_rates [k], data_in, ARRAY_LEN (data_in)); if (check_output (data_in, ARRAY_LEN (data_in)) != 0) errors ++ ; else { puts ("ok"); remove (filename); } } if (errors) exit (1); return 0; }
static void s3c4510_bus_read_start( bus_t *bus, uint32_t adr ) { /* see Figure 4-19 in [1] */ part_t *p = PART; chain_t *chain = CHAIN; part_set_signal( p, nRCS[0], 1, 0 ); part_set_signal( p, nRCS[1], 1, 1 ); part_set_signal( p, nRCS[2], 1, 1 ); part_set_signal( p, nRCS[3], 1, 1 ); part_set_signal( p, nRCS[4], 1, 1 ); part_set_signal( p, nRCS[5], 1, 1 ); part_set_signal( p, nWBE[0], 1, 1 ); part_set_signal( p, nWBE[1], 1, 1 ); part_set_signal( p, nWBE[2], 1, 1 ); part_set_signal( p, nWBE[3], 1, 1 ); part_set_signal( p, nOE, 1, 0 ); setup_address( bus, adr ); set_data_in( bus ); chain_shift_data_registers( chain, 0 ); }