Forum Discussion
Altera_Forum
Honored Contributor
7 years ago --- Quote Start --- core_readdatavalid and core_full are signals from the part of my code that does the processing. source_empty signals the code to stop reading after a certain number of bytes has been read. I am confused by your "always @ (data_input)". Either I misunderstand what you're trying to do, or this is wrong (or both). It should be "always @(posedge clk)" where clk is the clock that is associated with mm_bridge_0_s0. If the write succeeds (you come into the block, you have data to write, and mm_bridge_0_s0_waitrequest is low), you do whatever has to be done to replace data_input with the next value to write. I use the entire top 512M for transferring data in and out. 2000_0000 to 2800_0000 is input buffer (written by the HPS and read by the FPGA) and 2800_0000 onwards is the output buffer (written by the FPGA and read by the HPS). Yes, the resulting data should be visible to a code like that at address 2800_0000. --- Quote End --- What I am trying to do is send the data every time I get new data, aka every time it changes. The overall idea of how this project will work, or what I need it to do: 1) I get some data over FPGA GPIO. 2) The FPGA does some formatting with the data. 3) As soon as the its ready, it sends it to the HPS DDR memory. 4) Once the FPGA has written an entire packet, interrupts the HPS to let it know its ready. 5) HPS reads it and sends it out over the network. So my idea was everytime data_input changes it would launch the write block. But maybe like you said I should change the always to @(posedge clk) and then check inside that block if the data_input changed AND if the waitrequest is low? I'll edit this post once I work on that, hopefully that always block is what is causing my issue. Because I still wasn't able to see anything at that 2800_0000 address. What I don't want happening is the system to write data multiple times. So, if no new data has been sent, the block still executes on the clock cycle and writes a single data point twice. Maybe always@(posedge clk AND data_input) would work? I'm going to try and run some tests but its hard since I cant even get anything to write to the DDR right now. EDIT: I can now successfully write! However for some reason I can only write 32 Bits at a time instead of 128, not sure why yet.