int mtsp(int argc, char * const *argv)
{
	uint32_t  mem_test_size, patterns_to_activate;
	uint32_t  startAddr, test_times, i;

	logout_mode = FULL_MODE;
	test_times = 1;
	switch (argc) {
	case 1:
		printf("mtsp--> Enter the start addr to be tested\n");
		break;
	case 2:
		printf("mtsp--> Enter number of byte to be tested\n");
		break;
	case 3:
		printf("mtsp--> Set bits of the test to be run\n");
		break;
	case 5:
		test_times = conv_dec((char *)argv[4]);
	case 4:
		mem_test_size = conv_hex((char *)argv[2]);
		startAddr = conv_hex((char *)argv[1]);
		patterns_to_activate = conv_hex((char *)argv[3]);
		for (i = 0; i < test_times; i++) {
			printf("\n**** MTSP TEST LOOP: %d *****\n", i + 1);
			if (mtsp_test(startAddr, mem_test_size,
						patterns_to_activate, 0))
				return -1;
		}
		break;
	default:
		break;
	}
	return 0;
}
示例#2
0
void my_rev_fath(vector<double>& fath_vec, vector<double>& moth_vec, vector<double>& h_vec,  vector<double>& fath_up_vec)
{
  unsigned int len=fath_vec.size();  
  unsigned int lenup=fath_up_vec.size();  
  vector<double> dyfath_vec(2*len-1,0.0);
  vector<double> dymoth_vec(2*len-1,0.0);
  
  dydadup(fath_vec,dyfath_vec);
  dydadup(moth_vec,dymoth_vec);
  
  vector<double> fconv(h_vec.size()+2*len-2,0.0);
  vector<double> mconv(h_vec.size()+2*len-2,0.0);  
 
  db_vit fconv_vit=fconv.begin(); 
  db_vit mconv_vit=mconv.begin();
  
  vector<double> sconv(h_vec.size()+2*len-1,0.0);
  conv_dec(h_vec.begin(), h_vec.end(), 3, dyfath_vec.begin(), dyfath_vec.end(), 0, fconv_vit);
  conv_dec(h_vec.begin(), h_vec.end(), 0, dymoth_vec.begin(), dymoth_vec.end(), 0, mconv_vit);
  VVdif(&fconv,&mconv, &sconv);
  
  for(unsigned int it=0;it<lenup;it++)
    fath_up_vec[it]=*(sconv.begin()+h_vec.size()-2+it);  
}
int do_mdcp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	ulong start, size, memsize = 0, banksize = 0;
	uint32_t loop, idle, cpufreq;
	uint32_t i = 0;
	uint32_t total, data, busy;
	uint32_t dump = 0, showup = 0;

	if (argc != 6) {
		mdcp_help();
		return 0;
	}

	start = conv_hex((char *)argv[1]);
	size = conv_dec((char *)argv[2]);
	loop = conv_dec((char *)argv[3]);
	idle = conv_dec((char *)argv[4]);
	cpufreq = conv_dec((char *)argv[5]);

	for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
		MCK5_sdram_size(i, &banksize);
		memsize += banksize;
	}

	if ((start + size * 2048) > memsize) {
		printf("memcpy size exceeds the total memory size: 0x%lx\n",
			memsize);
		return 0;
	}

	printf("memcpy %lu KB at 0x%lx for %d loop,", size, start, loop);
	if (idle > 0)
		printf("then idle for %d ms ", idle);
	else
		printf("without idle ");
	printf("at cpu %dMhz\n", cpufreq);

	while (1) {
		dump++;

		if ((dump % 300) == 0) {
			/* init DDR performance counter */
			MCK5_perf_cnt_clear(0x7);
			MCK5_perf_cnt_init();
		}

		/* do memcpy */
		for (i = 0; i < size * 1024; i = i + 4)
			*(u32 *)(start + size * 1024 + i)
				= *(u32 *)(start + i);

		/* sleep */
		if (idle > 0)
			loop_delay(idle * 1000 * cpufreq);

		if ((dump % 300) == 0) {
			/* calculate data_ratio/busy_ratio */
			MCK5_perf_cnt_stop();
			MCK5_perf_cnt_get(&total, &busy, &data);
			data = data * 4;

			if (showup < loop) {
				showup++;
				printf("%d.%d\t %d.%d\n", busy*100/total,
					((busy*100)%total)*100/total,
					data*100/total,
					((data*100)%total)*100/total);
			} else {
				printf("end\n");
				break;
			}
		}
	}

	return 1;
}
示例#4
0
void my_for_moth(vector<double>& fath_vec, vector<double>& h_vec, db_vit &moth_dn_vit)
{
  conv_dec(h_vec.begin(), h_vec.end(), 1, fath_vec.begin(), fath_vec.end(),1, moth_dn_vit);
}
示例#5
0
void my_for_fath(vector<double>& fath_vec, vector<double>& h, vector<double> &fath_dn_vec)
{
  db_vit fath_dn_vit=fath_dn_vec.begin();
  conv_dec(h.begin(), h.end(), 2, fath_vec.begin(), fath_vec.end(), 1,  fath_dn_vit);
}