I tried to create a simple dual port ram using instantiation template code given for the block ram generator (v8.4) in Vivado with common clock configuration.
Port A - read first mode, always enabled
Port B - read first mode, ENB activated
BRAM configurations are also given below.
When I tried to simulate the BRAM, I observed thatwea or wr_en sampled at negative edge and as a result, data value at the immediate positive clock edge will be written to the BRAM.
I found it when I was reading the written data from the BRAM. Please go through following image and I attached a waveform to get an idea about the issue.
Simulation waveform file (.wcfg) also added as a zipped-file.
As you can see in the simulation waveform, at 165 ns, wea will be sampled at negative clock edge and as a result data_wr of 63 will be written at addr_wr of 1 in BRAM in the immediate positive clock edge.
Now if you check 240 ns, you can see 63 value has been read from the 1st location of the BRAM. I clearly don't understand this behaviour, since I haven't configured the BRAM to work with clock inversion. Therefore, it should clearly work with positive clock edge.
Can anyone please tell me is it possible to sample write enable of port A at negative edge of the clock ?
I checked it in the pg058 user guide relevant for block ram generator, but didn't find any clue on that.
Testbench code is given as follows for the above simulation graph.