⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 l2.asm

📁 基于IBM的NPU
💻 ASM
📖 第 1 页 / 共 5 页
字号:
       and    r15, r6                   ; copy last 4 bits of top16 bits of address to r15       slr    r6, #5                   ; move the reserved bit out       sll    r6, #4                   ; realign the bits back without the reserved bit.       or     r6, r15                  ; put back the last 4 bits of top16 bits of address       ldr    w10, DataPool[r0]           str    TSR0[0], w10             ; Load the first 4 bytes into TSR       add    r0, #4       ldr    w10, DataPool[r0]    ; Load the next 4 bytes into TSR       str    TSR0[4], w10       cmp    r12,#2       be     only64w       add    r0      , #4       ldr    w10     , DataPool[r0]           str    TSR0[8] , w10             ; Load the next 4 bytes into TSR       add    r0      , #4       ldr    w10     , DataPool[r0]    ; Load the next 4 bytes into TSR       str    TSR0[12] , w10only64w EQU $       str    LCBA0   , w6              ; Store the address into Lcba       ldr    r12, #1       mwr    #0x0000                   ; Write into control memory               b      WordLoopEnd       ;****************************************************************       ; CAB write       ;****************************************************************do_cab_write EQU $       ldr    w10     , DataPool[r0]    ; Load the Data word from DataPool       str    cabdata , w10             ; Present it to the write CAB interface       cabaccess  w6  , #cabwrite       ; Request CAB Write at Running Address       wait   COP_CAB                   ; Wait for the CAB processor to complete       b      WordLoopEnd               ;              ;****************************************************************       ; Reads       ;****************************************************************Guided_Read   EQU $                     ;                                         ; r6 has the address       ldr    r10     , r6              ; Check which island the guided write is       and    r10     , #gf_isl_id_mask ; intended.        cmp    r10     , #gf_ctrl_mem_id ; If it is NOT for control memory       bne    do_cab_read               ;    jump to handle CAB read               ;****************************************************************       ; Control memory read       ;****************************************************************       ldr    r15, #0x000F       and    r15, r6                   ; copy last 4 bits of top16 bits of address to r15       slr    r6 , #5                   ; move the reserved bit out       sll    r6 , #4                   ; realign the bits back without the reserved bit.       or     r6 , r15                  ; put back the last 4 bits of top16 bits of address       str    LCBA0   , w6              ; Store the address into Lcba       mrd    #0x0000                   ; Do a memory read, results in TSR0              ldr    w10     , TSR0[0]         ; copy the read data into the element       str    DataPool[r0], w10         ;   data of the guided frame       add    r0      , #4       ldr    w10     , TSR0[4]       str    DataPool[r0], w10       cmp    r12,#2       be     only64r       add    r0      , #4       ldr    w10     , TSR0[8]       str    DataPool[r0], w10       add    r0      , #4       ldr    w10     , TSR0[12]       str    DataPool[r0], w10only64r EQU $       ldr    r12     , #1       b WordLoopEnd       ;****************************************************************       ; CAB read       ;****************************************************************       do_cab_read EQU $       cabaccess  w6, #cabread          ; Request CAB Read  at Running Address       wait   COP_CAB                   ; Wait for the CAB processor to complete       ldr    w10, cabdata              ; Copy the read data into the element       str    DataPool[r0], w10         ;   data of the guided frame              ;****************************************************************       ; Read/Write code merges here to process next word        ;****************************************************************       WordLoopEnd   EQU $       add    w6 , #1                   ; Increment Running Address       add    r0, #4                    ; Take care of next word       sub    r12, #1                   ; Decrement Word Count in Element       bnz    WordLoop                  ;       add    w4 , r2                   ; Increment Starting Address by Element Increment       sub    r9 , #1                   ; Decrement Element Count       bne    ElementLoop               ;              ;****************************************************************       ; Done processing Read/Write command.         ;****************************************************************              cabarb #cabrelease               ; Releases the CAB access              ldr    r15, #0x4000              ; Set Response bit in frame ctrl       or     r14, r15                  ;       ldr    r15, #0x0000              ;       ldr    w10, DataPool[0x00]       ;       or     w14,w10                   ;       str    DataPool[0x00], w14       ;        Update_Frame    EQU $                   ; Update Guided Frame (write back in DS)       ldr    w0 , CCTA                 ; Load current address into DSA       str    DSA, w0                   ;       ldr    r0 , #0x0010              ; Read from DataPool starting at fish 0       str    LMA, r0                   ;       wrids #0                         ; Store 4 fishes from DataPool into DS       b      Enqueue_section       ;****************************************************************       ; Other Guided Commands (besides read/write)       ;****************************************************************Not_Read_Write  EQU $       ldr    r1 , #gf_leaf_mask        ; Is it one of the leaf commands?       and    r1 , r3       cmp    r1 , #gf_leaf_mask                      bne    Not_Leaf                  ; No, jump       ;****************************************************************       ; Leaf Commands        ;**************************************************************** Leaf_End      EQU $       b      Enqueue_section              ;****************************************************************       ; Other Commands        ;****************************************************************Not_Leaf        EQU $       ldr    r1 , #gf_other_mask       ; Is it the End Delim command?       and    r1 , r3       cmp    r1 , #gf_end_del                       bne    Not_End_Del               ; No, jump       ;****************************************************************       ; End Delimiter        ;****************************************************************End_Del_End     EQU $       b      Enqueue_sectionNot_End_Del     EQU $       ldr    r1 , #gf_other_mask       ; Is it the Build free list cmd?       and    r1 , r3       cmp    r1 , #gf_free_list                       bne    Not_Build_FL              ; No, jump              ;****************************************************************       ; Build TSE Free List         ;****************************************************************        End_Build_FL    EQU $       b      Enqueue_sectionNot_Build_FL    EQU $       ldr    r1 , #gf_other_mask       ; Is it an Unsolicited cmd?       and    r1 , r3       cmp    r1 , #gf_unsolicited                    bne    Sw_Action                 ; No, jump to handle sw action              ;****************************************************************       ; Unsolicited         ;****************************************************************       b      Enqueue_section              ;****************************************************************       ; Software Action         ;****************************************************************Sw_Action EQU $Remote_Blade EQU $       ;****************************************************************       ; Prepare the Frame Control Block (FCB) and enqueue the frame         ;****************************************************************Enqueue_section EQU $                                        ; --- FCB setup -------------       ldr   r12, #1                    ; Set guided traffic       str   GT , r12                   ;                                               ldr   w14, DataPool[0x00]        ; Update the TB value using the value from       str   TB , r15                   ; the guided frame's Frame Control info                                               ldr   r12, #2                    ; High Priority & No Special Function       str   Priority_SF, r12                   ;                                               ldr   r12, #0                    ; Multicast Frame       str   iUCnMC, r12                ;                                               ldruo w12, #0x0001               ; Multicast Identifier (MID) set       str   MID, w12                   ; MID = 0x0001 FFFF       ldr   r12, #0                    ; Frame Header Format (FHF)       str   FHF, r12                  ;                  ldr   r12, #0xFEFC               ; Frame Header Extension (FHE)        ldr   r13, #0xAA55               ;       str   FHE, w12                   ;       enqi  #UP_TXQ                    ; Enqueue to the UP Multicast queue              exit;**********************************************************************;;            DN Guided Cell Handler                                    ;;**********************************************************************;;; Purpose; *******; This code handles guided traffic on the DN side. It takes the guided; cell that was processed on the UP side, inserts the 14 bytes of DA,; SA, and ETH type and enqueues it to the DN target port queue. The; 14 bytes were stripped from the guided cell by the MAC and need to; be re-inserted before the frame is sent out.;; Input Parameters; ****************; None;; Returned Values; ***************; None;; General Purpose Registers Destroyed; ***********************************; w0  : address of first byte of frame header on entry; w2  : working register; r6  : working register ; w20 : working register;; Array Register Locations Destroyed; **********************************; None;; Pre-Conditions; **************; None;; Post-Conditions; ***************; None;;**********************************************************************;        ORG 0x0800                ;**************************************************************        ; Set FCB Page to indicate egress frame alteration with        ; hardware assist - SA/DA insert, E_Type insert, CRC overlay        ;**************************************************************                ldr   r2, #0x0001        str   EtypeAct, r2      ; Set up to overwrite Ethertype                ldr   r2, #0x0002        str   EN_HWA, r2        ; Set up to insert DA and SA                ldr 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -