<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ` `Xilinx SDK使用的是GCC,實際上這個方法也適用于所有GCC源碼。 ` `首先在聲明變量的時候在后面增加attribute。 `int matrix[16][16384] __attribute__((section(".matrix"))); ` ` `然后在Linker Script里面做如下修改: ` `1. 雙擊打開lscript.ld,在GUI的Available Memory Region里面增加需要的內存區域。當然這一步也可以直接用Text Editor編輯lscript.ld完成。 ` `2. 右鍵單擊lscript.ld,單擊Open With->Text Editor。在其中增加.matrix的定義。 編輯完成后的lscript.ld 如下所示: ```c MEMORY { ?? ps7_ddr_0_S_AXI_BASEADDR : ORIGIN = 0x00100000, LENGTH = 0x3FF00000 ?? ps7_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00030000 ?? ps7_ram_1_S_AXI_BASEADDR : ORIGIN = 0xFFFF0000, LENGTH = 0x0000FE00 ?? ps7_ddr_0_A_AXI_MATRIX? : ORIGIN = 0x20000000, LENGTH = 0x100000 } .matirx : { ?? __matrix_start = .; ?? *(.matrix) ?? *(.matrix.*) ?? __matrix_end = .; } > ps7_ddr_0_A_AXI_MATRIX _end = .; } ``` ` `注意:如果Linker Script配置不對,編譯不會報錯,而是直接把變量放到.data section里面。所以源碼里面最好檢查一下。 ## 其他常用的Attribute ``` 1. aligned (alignment) This attribute specifies a minimum alignment for the variable or structure field, measured in bytes. 例子: ???????? int x __attribute__ ((aligned (16))) = 0; ? ? ? ?? struct foo { int x[2] __attribute__ ((aligned (8))); }; ? ? ? ?? short array[3] __attribute__ ((aligned (__BIGGEST_ALIGNMENT__))); 2. packed The packed attribute specifies that a variable or structure fieldshould have the smallest possible alignment—one byte for a variable,and one bit for a field, unless you specify a larger value with thealigned attribute. 例子: ????????? struct foo ????????? { ??????????? char a; ??????????? int x[2] __attribute__ ((packed)); ????????? }; ``` ` `**這種方法分配的空間移植性不太好,為了移植性更好,使用指針的形式分配實際物理空間給數組。通過指針直接指定地址。** ```c //定義AD數據基地址 #define AK_5394_DATA_BUF_LEN 204800 //設置數據最大長度 #define AK_5394_DATA1_BASE_ADDR (0x04000000U) //AD數據1基地址 #define AK_5394_DATA2_BASE_ADDR (AK_5394_DATA1_BASE_ADDR + AK_5394_DATA_BUF_LEN*4)//AD數據2基地址 #define AK_5394_TIME1_BASE_ADDR (AK_5394_DATA2_BASE_ADDR + AK_5394_DATA_BUF_LEN*4)//AD數據獲取時間1基地址 #define AK_5394_TIME2_BASE_ADDR (AK_5394_TIME1_BASE_ADDR + AK_5394_DATA_BUF_LEN*4)//AD數據獲取時間2基地址 int *ak5394_m1=(int*) AK_5394_DATA1_BASE_ADDR;// int *ak5394_m2=(int*) AK_5394_DATA2_BASE_ADDR;// //分配DDR中對應AD數據時間的內存地址給數組 u32 *ak5394_t1 = (u32 *)AK_5394_TIME1_BASE_ADDR;// u32 *ak5394_t2 = (u32 *)AK_5394_TIME2_BASE_ADDR;// ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看