IMPORTANT NOTICE: Please be advised that the Verification Academy Forums will be offline for scheduled maintenance on Sunday, March 23rd at 4:00 US/Pacific.
I am new to system verilog and trying fifo example.
I am not able to get the fifo output ,can you suggest me a solution.
And one more doubt,as it is synchronous we will be getting the output after 1 cycle delay irrespective of keeping the write or read enable high but with respect to my case ,i am not able to get the required output.
In reply to veeresh_03:
Please use code tags to make your code more readable, IO have added them for you this time. It would also help if you provided information about the results you are seeing versus what you expect to see.
One of your problems is you do not reset fifo_count.
In reply to veeresh_03:
Your approach to the FIFO is incorrect. A typical FIFO has 2 pointers: A WRITE pointer and a READ pointer. You only have ONE pointer, and that would not work.
On WRITEs, you use the mem_space (mem_space[fifo_count]<=data_in;). On READs you just transfer the input data to the output (else if(read && !write) data_out<=data_in;). ?? That is not a FIFO.
In my SVA Handbook 4th Edition I use a FIFO to demonstrate the definition of requirements for a FIFO, and a set of assertions for a FIFO.
Am giving you links to my model. Try to understand it. Also, use assertions.
BTW, don’t use the “reg”, use “logic”. HTTP://SystemVerilog.US/VF/fifo_rtl.sv HTTP://SystemVerilog.US/VF/fifo_props.sv HTTP://SystemVerilog.US/VF/fifo_if.sv
[*] yes i understood that part,but when i changed it to two pointers like this.
mem_space[fifo_count]<=data_in;
data_out<=mem_space[fifo_count];
[*] and tried the other way around by using two pointers also,
mem_space[write_ptr]<=data_in;
data_out<=mem_space[read_ptr];
[*] I had set the two different pointers,but but if i havve set the two pointers differently ,how can they point to a common memory from where they can copy the data,
I guess ,i am missing out on some point here.
If the FIFO is small, you can use registers. But I believe that a good sysnthesis tool can help you in that regards. We don’t discuss tool. If you have an specific IP. then ypu’ll have to instantiate the IP and do your design around it.