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

📄 ls_test.psm

📁 和picoblaze完全兼容的mcu ip core
💻 PSM
📖 第 1 页 / 共 5 页
字号:
                     ; KCPSM3 Program - Program to test line stores using the Spartan-3E Starter Kit.
                     ;
                     ; Ken Chapman - Xilinx Ltd
                     ;
                     ; Version v1.00 - 26th June 2006
                     ;
                     ; PicoBlaze communicates via the UART to control the value applied to the inputs of
                     ; line stores and enable them for a specified number of clock cycles. The outputs of
                     ; all the line stores are then displayed.
                     ;
                     ;**************************************************************************************
                     ; Port definitions
                     ;**************************************************************************************
                     ;
                     ;
                     ;
                     CONSTANT LED_port, 80                  ;8 simple LEDs
                     CONSTANT LED0, 01                      ;     LED 0 - bit0
                     CONSTANT LED1, 02                      ;         1 - bit1
                     CONSTANT LED2, 04                      ;         2 - bit2
                     CONSTANT LED3, 08                      ;         3 - bit3
                     CONSTANT LED4, 10                      ;         4 - bit4
                     CONSTANT LED5, 20                      ;         5 - bit5
                     CONSTANT LED6, 40                      ;         6 - bit6
                     CONSTANT LED7, 80                      ;         7 - bit7
                     ;
                     ;
                     ;UART ports
                     ;
                     CONSTANT status_port, 00               ;UART status input
                     CONSTANT tx_half_full, 01              ;  Transmitter     half full - bit0
                     CONSTANT tx_full, 02                   ;    FIFO               full - bit1
                     CONSTANT rx_data_present, 04           ;  Receiver     data present - bit2
                     CONSTANT rx_half_full, 08              ;    FIFO          half full - bit3
                     CONSTANT rx_full, 10                   ;                   full - bit4
                     ;
                     CONSTANT UART_read_port, 01            ;UART Rx data input
                     ;
                     CONSTANT UART_write_port, 40           ;UART Tx data output
                     ;
                     ;
                     ;The first line store input is 18-bits and requires 3 bytes
                     ;to be written to a holding register. Then when required,
                     ;the whole 18-bit value can be stored in the line store
                     ;using a dummy write (data not used) to a forth port.
                     ;
                     ;
                     CONSTANT line_store_input_L, 01        ;Line Store input bits [7:0]
                     CONSTANT line_store_input_M, 02        ;Line Store input bits [15:8]
                     CONSTANT line_store_input_H, 04        ;Line Store input bits [17:16]
                     CONSTANT line_store_write_en, 08       ;Line Store clock enable (dummy write)
                     ;
                     ;
                     ;
                     ;The first line store 768x24 and requires 3 bytes to be read.
                     ;
                     CONSTANT line_store1_output_L, 02      ;Line Store output bits [7:0]
                     CONSTANT line_store1_output_M, 03      ;Line Store output bits [15:8]
                     CONSTANT line_store1_output_H, 04      ;Line Store output bits [23:16]
                     ;
                     ;
                     ;The second line store 1024x18 and requires 3 bytes to be read.
                     ;
                     CONSTANT line_store2_output_L, 05      ;Line Store output bits [7:0]
                     CONSTANT line_store2_output_M, 06      ;Line Store output bits [15:8]
                     CONSTANT line_store2_output_H, 07      ;Line Store output bits [17:16]
                     ;
                     ;
                     ;The third line store 1280x13 and requires 2 bytes to be read.
                     ;
                     CONSTANT line_store3_output_L, 08      ;Line Store output bits [7:0]
                     CONSTANT line_store3_output_H, 09      ;Line Store output bits [12:8]
                     ;
                     ;
                     ;The forth line store is 1280x72 so to make it more manageable it has been
                     ;folded to make it 3 times longer and only 24-bits wide. This requires 3 bytes
                     ;to be read at each 1280 delay tapping point.
                     ;
                     CONSTANT line_store4a_output_L, 0A     ;Line Store output bits [7:0]   First tap
                     CONSTANT line_store4a_output_M, 0B     ;Line Store output bits [15:8]
                     CONSTANT line_store4a_output_H, 0C     ;Line Store output bits [23:16]
                     ;
                     CONSTANT line_store4b_output_L, 0D     ;Line Store output bits [31:24] Second tap
                     CONSTANT line_store4b_output_M, 0E     ;Line Store output bits [39:32]
                     CONSTANT line_store4b_output_H, 0F     ;Line Store output bits [47:40]
                     ;
                     CONSTANT line_store4c_output_L, 10     ;Line Store output bits [55:48] Third tap
                     CONSTANT line_store4c_output_M, 11     ;Line Store output bits [63:56]
                     CONSTANT line_store4c_output_H, 12     ;Line Store output bits [71:64]
                     ;
                     ;
                     ;The fifth line store 1536x12 and requires 2 bytes to be read.
                     ;
                     CONSTANT line_store5_output_L, 13      ;Line Store output bits [7:0]
                     CONSTANT line_store5_output_H, 14      ;Line Store output bits [11:8]
                     ;
                     ;
                     ;The sixth line store 1920x9 and requires 2 bytes to be read.
                     ;
                     CONSTANT line_store6_output_L, 15      ;Line Store output bits [7:0]
                     CONSTANT line_store6_output_H, 16      ;Line Store output bit [8]
                     ;
                     ;
                     ;The seventh line store is 1920x48 so to make it more manageable it has been
                     ;folded to make it 2 times longer and only 24-bits wide. This requires 3 bytes
                     ;to be read at each 1920 delay tapping point.
                     ;
                     CONSTANT line_store7a_output_L, 17     ;Line Store output bits [7:0]   First tap
                     CONSTANT line_store7a_output_M, 18     ;Line Store output bits [15:8]
                     CONSTANT line_store7a_output_H, 19     ;Line Store output bits [23:16]
                     ;
                     CONSTANT line_store7b_output_L, 1A     ;Line Store output bits [31:24] Second tap
                     CONSTANT line_store7b_output_M, 1B     ;Line Store output bits [39:32]
                     CONSTANT line_store7b_output_H, 1C     ;Line Store output bits [47:40]
                     ;
                     ;
                     ;**************************************************************************************
                     ; Special Register usage
                     ;**************************************************************************************
                     ;
                     NAMEREG sF, UART_data                  ;used to pass data to and from the UART
                     ;
                     ;
                     ;
                     ;**************************************************************************************
                     ;Scratch Pad Memory Locations
                     ;**************************************************************************************
                     ;
                     CONSTANT step_counter0, 00             ;decimal count of line store write operations
                     CONSTANT step_counter1, 01
                     CONSTANT step_counter2, 02
                     CONSTANT step_counter3, 03
                     CONSTANT step_counter4, 04
                     ;
                     CONSTANT test_data_in0, 05             ;24-bit data applied to line store input
                     CONSTANT test_data_in1, 06
                     CONSTANT test_data_in2, 07
                     ;
                     CONSTANT n_count0, 08                  ;decimal count cycles to count in command
                     CONSTANT n_count1, 09
                     CONSTANT n_count2, 0A
                     CONSTANT n_count3, 0B
                     ;
                     ;
                     CONSTANT auto_inc, 0C                  ;Determines if auto increment is active
                     ;
                     CONSTANT fast_mode, 0D                 ;Determines if fast mode is active
                     ;
                     ;UART character strings will be stored in scratch pad memory ending in carriage return.
                     ;A string can be up to 16 characters with the start location defined by this constant.
                     ;
                     CONSTANT string_start, 30
                     ;
                     ;
                     ;
                     ;**************************************************************************************
                     ;Useful data constants
                     ;**************************************************************************************
                     ;
                     ;
                     ;
                     ;
                     ;ASCII table
                     ;
                     CONSTANT character_a, 61
                     CONSTANT character_b, 62
                     CONSTANT character_c, 63
                     CONSTANT character_d, 64
                     CONSTANT character_e, 65
                     CONSTANT character_f, 66
                     CONSTANT character_g, 67
                     CONSTANT character_h, 68
                     CONSTANT character_i, 69
                     CONSTANT character_j, 6A
                     CONSTANT character_k, 6B
                     CONSTANT character_l, 6C
                     CONSTANT character_m, 6D
                     CONSTANT character_n, 6E
                     CONSTANT character_o, 6F
                     CONSTANT character_p, 70
                     CONSTANT character_q, 71
                     CONSTANT character_r, 72
                     CONSTANT character_s, 73
                     CONSTANT character_t, 74
                     CONSTANT character_u, 75
                     CONSTANT character_v, 76
                     CONSTANT character_w, 77
                     CONSTANT character_x, 78
                     CONSTANT character_y, 79
                     CONSTANT character_z, 7A
                     CONSTANT character_A, 41
                     CONSTANT character_B, 42
                     CONSTANT character_C, 43
                     CONSTANT character_D, 44
                     CONSTANT character_E, 45
                     CONSTANT character_F, 46
                     CONSTANT character_G, 47
                     CONSTANT character_H, 48
                     CONSTANT character_I, 49
                     CONSTANT character_J, 4A
                     CONSTANT character_K, 4B
                     CONSTANT character_L, 4C
                     CONSTANT character_M, 4D
                     CONSTANT character_N, 4E
                     CONSTANT character_O, 4F
                     CONSTANT character_P, 50
                     CONSTANT character_Q, 51
                     CONSTANT character_R, 52
                     CONSTANT character_S, 53
                     CONSTANT character_T, 54
                     CONSTANT character_U, 55
                     CONSTANT character_V, 56
                     CONSTANT character_W, 57
                     CONSTANT character_X, 58
                     CONSTANT character_Y, 59
                     CONSTANT character_Z, 5A
                     CONSTANT character_0, 30
                     CONSTANT character_1, 31
                     CONSTANT character_2, 32
                     CONSTANT character_3, 33
                     CONSTANT character_4, 34
                     CONSTANT character_5, 35
                     CONSTANT character_6, 36
                     CONSTANT character_7, 37
                     CONSTANT character_8, 38
                     CONSTANT character_9, 39
                     CONSTANT character_colon, 3A
                     CONSTANT character_stop, 2E
                     CONSTANT character_semi_colon, 3B
                     CONSTANT character_minus, 2D
                     CONSTANT character_divide, 2F          ;'/'
                     CONSTANT character_plus, 2B
                     CONSTANT character_comma, 2C
                     CONSTANT character_less_than, 3C
                     CONSTANT character_greater_than, 3E
                     CONSTANT character_equals, 3D
                     CONSTANT character_space, 20
                     CONSTANT character_CR, 0D              ;carriage return
                     CONSTANT character_question, 3F        ;'?'
                     CONSTANT character_dollar, 24
                     CONSTANT character_exclaim, 21         ;'!'
                     CONSTANT character_BS, 08              ;Back Space command character
                     ;
                     ;
                     ;
                     ;

⌨️ 快捷键说明

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