📄 me_4k_control_store_test.uc
字号:
/* 4k_ustore_test.uc
*
*---------------------------------------------------------------------------
*
* I N T E L P R O P R I E T A R Y
*
* COPYRIGHT (c) 2002 BY INTEL CORPORATION. ALL RIGHTS
* RESERVED. NO PART OF THIS PROGRAM OR PUBLICATION MAY
* BE REPRODUCED, TRANSMITTED, TRANSCRIBED, STORED IN A
* RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER
* LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,
* MAGNETIC, OPTICAL, CHEMICAL, MANUAL, OR OTHERWISE, WITHOUT
* THE PRIOR WRITTEN PERMISSION OF :
*
* INTEL CORPORATION
*
* 2200 MISSION COLLEGE BLVD
*
* SANTA CLARA, CALIFORNIA 95052-8119
*
*---------------------------------------------------------------------------
*
*
* system: IXP2000
* subsystem: DIAG
* author: ccm, Mar 14, 02
*
* --------------------------------------------------------------------------
*/
// *NOTE*: Alternative #1 might not detect faults at bne[SEND_STATUS#] but
// provides the granularity of error detection
// Whereas Alternative #2 will detect errors at any location but
// does not provide approximation of error location.
#include "../../../include/me_xscale_sync.h"
#ifndef ALTERNATIVE
#define ALTERNATIVE 1
#endif
#define NUM_OF_LOOPS (NUM_OF_LINES_TO_GEN - 12)
#define x 1 // incremented value used for checking against alu operations
.reg counter temp base me me_offset
.reg $status
.sig scratch_write
immed[counter, 0x1]
immed[base, 0x4]
#if (ALTERNATIVE == 1)
#while(x <= (NUM_OF_LOOPS/4))
#define_eval x (x + 1)
alu[counter, counter, +, 1] // increments counter
immed[temp, x] // move constant to be compared
alu[--, counter, -, temp] // determine if any instructions were skipped
bne[SEND_STATUS#]
#endloop
#elif (ALTERNATIVE == 2)
#while(x <= NUM_OF_LOOPS)
alu[counter, counter, +, 1] // increments counter
#define_eval x (x + 1)
#endloop
#endif
SEND_STATUS#:
// writes counter value to scratch to be verified by XScale
// calculate me_offset
local_csr_rd[active_ctx_sts]
immed[me, 0]
alu_shf[me, 0x1f, AND, me, >>3]
alu[me_offset, 0x3, AND, me]
alu[--, me, -, 0x3]
ble[me_offset_obtain#]
alu[me_offset, me_offset, OR, 0x4]
me_offset_obtain#:
alu_shf[me_offset, --, B, me_offset, <<2]
alu[$status, --, B, counter]
scratch[write, $status, base, me_offset, 1], ctx_swap[scratch_write]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -