У меня к системе подключено 512мб ДДР памяти...ну и еще 16кб БРАМ.
С помощью Wizard я создал peripheral с функцией Master.
моя зада4а например сделать так чтобы етот мастер модуль считал данные из своих slave регистров в ДДР память(в двльнейшем будет наоьорот...Периферал будет считывать значения из ДДР)..
вот кусок кода:
Код
Xuint32 data; // variable for test
// PREPARATION!
// Set the base address of the DDR to a visible value. We will manipulate it later.
XIo_Out32(0xd0000000, 0xABCD1234);
// Write another distinctive value into the first reg (slv_reg0) of the peripheral.
XIo_Out32(XPAR_VIDEO_CTRL_0_BASEADDR + 0x00, 0xAABBCCDD);
data = XIo_In32(0xd0000000);
xil_printf("Value of the DDR (before master transfer) = : %x\r\n", data);
data = XIo_In32(XPAR_VIDEO_CTRL_0_BASEADDR + 0x00);
xil_printf("Value of the slv_reg0 (before master transfer) = : %x\r\n", data);
// COMMANDING THE MASTER!
// Write 0x40 to the control register on the master peripheral
XIo_Out8(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x00, 0x40);
// Write the source address for the write to the IP2IP register on the master peripheral
// In our example, we'll use slv_reg0 in the peripheral.
XIo_Out32(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x04, XPAR_VIDEO_CTRL_0_BASEADDR + 0x00);
// Write the destination address for the write to the IP2BUS register on the master peripheral
// In our example, we'll overwite the same BRAM location that we set earlier.
XIo_Out32(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x08, 0xd0000000);
// Write the length of the transfer (in bytes) to the LENGTH register on the master peripheral
// In our example, we only want to send one word (4 bytes).
XIo_Out16(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x0C, 0x04);
// Write a value for the byte enables to the BE register on the master peripheral
// In our example, we are writing to a 0x???????0 address, so we'll use half of the 64 bit PLB
XIo_Out8(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x0E, 0xf0);
// Write the special "GO" command into the GO Register on the master peripheral
// The GO command is always 0x0A
XIo_Out8(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x0F, 0x0A);
// Wait to see what happens! The DDR address containing 0xABCD1234 should be overwritten with 0xAABBCCDD
data = XIo_In32(0xd0000000);
xil_printf("Value of the DDR (AFTER master transfer) = : %x\r\n", data);
================================================================================
===
// PREPARATION!
// Set the base address of the DDR to a visible value. We will manipulate it later.
XIo_Out32(0xd0000000, 0xABCD1234);
// Write another distinctive value into the first reg (slv_reg0) of the peripheral.
XIo_Out32(XPAR_VIDEO_CTRL_0_BASEADDR + 0x00, 0xAABBCCDD);
data = XIo_In32(0xd0000000);
xil_printf("Value of the DDR (before master transfer) = : %x\r\n", data);
data = XIo_In32(XPAR_VIDEO_CTRL_0_BASEADDR + 0x00);
xil_printf("Value of the slv_reg0 (before master transfer) = : %x\r\n", data);
// COMMANDING THE MASTER!
// Write 0x40 to the control register on the master peripheral
XIo_Out8(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x00, 0x40);
// Write the source address for the write to the IP2IP register on the master peripheral
// In our example, we'll use slv_reg0 in the peripheral.
XIo_Out32(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x04, XPAR_VIDEO_CTRL_0_BASEADDR + 0x00);
// Write the destination address for the write to the IP2BUS register on the master peripheral
// In our example, we'll overwite the same BRAM location that we set earlier.
XIo_Out32(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x08, 0xd0000000);
// Write the length of the transfer (in bytes) to the LENGTH register on the master peripheral
// In our example, we only want to send one word (4 bytes).
XIo_Out16(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x0C, 0x04);
// Write a value for the byte enables to the BE register on the master peripheral
// In our example, we are writing to a 0x???????0 address, so we'll use half of the 64 bit PLB
XIo_Out8(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x0E, 0xf0);
// Write the special "GO" command into the GO Register on the master peripheral
// The GO command is always 0x0A
XIo_Out8(XPAR_VIDEO_CTRL_0_BASEADDR + master_reg_offset + 0x0F, 0x0A);
// Wait to see what happens! The DDR address containing 0xABCD1234 should be overwritten with 0xAABBCCDD
data = XIo_In32(0xd0000000);
xil_printf("Value of the DDR (AFTER master transfer) = : %x\r\n", data);
================================================================================
===
но почемуто мастер модуле пишет туда нулевые значения...
вот вывод:
Код
===============
Value of the DDR (before master transfer) = : ABCD1234
Value of the slv_reg0 (before master transfer) = : AABBCCDD
Value of the DDR (AFTER master transfer) = : 0
===============
Value of the DDR (before master transfer) = : ABCD1234
Value of the slv_reg0 (before master transfer) = : AABBCCDD
Value of the DDR (AFTER master transfer) = : 0
===============
ну и что ето bug? или может быть я чтото упустил?
кстати тоже самое происходит если я хочузаписать данные в BRAM...
есть какие нибудь соображения?
впервыйе пишу тут на русском... транслитом можно?