Giter Club home page Giter Club logo

cv-hpdcache's People

Contributors

aileonn avatar cfuguet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cv-hpdcache's Issues

Assertion failed at the start of the simulation

Hi,

I work at BSC, we are integrating the cache in a core and have an issue with the simulations (using Verilator 5.010) of the core using the cache. The output is as follows:

[0] %Error: hpdcache_rrarb.sv:117: Assertion failed in TOP.veri_top.DUT.dcache.hpdcache_ctrl_i.st0_arb_i.gnt_q_exactly_one_requester: arbiter: grant state is not one-hot
%Error: rtl/dcache/rtl/src/common/hpdcache_rrarb.sv:117: Verilog $stop
Aborting...

The issue is because at the start of the simulation, in file hpdcache_rrarb.sv, signal gnt_q is 0 (since verilator is a 2-state simulator) and so it fails the assert.

There is nothing wrong with the behavior itself, since the assert itself is correct, and gnt_q will be correct as soon as the reset signal is applied. The problem lies within the simulation setup, i.e. the initial value of gnt_q being set to 0. I suggest adding something such as:

`ifdef VERILATOR
initial begin
    gnt_q = {1'b1, {N-1{1'b0}}};
end
`endif

We have tested this internally and have had no problems. If needed I can submit a pull request.

Thanks,
Arnau.

Refills failed when HPDCACHE_ACCESS_WORDS is 1 or equal to HPDCACHE_CL_WORDS

Hello! I am Noelia Oliete.

During the integration of the HPDC and OpenPiton for the GSoC'23, I detected that the refills don't work when the configurable parameter HPDCACHE_ACCESS_WORDS is equal to 1 or to HPDCACHE_CL_WORDS (Now I am using 16B/cache line).

  • For the first case, HPDCACHE_ACCESS_WORDS=1, the function hpdcache_compute_data_ram_cs (located in hpdcache_memctrl.sv) returns the following compilation error:

End index -1 of part-select into 'word_i' is out of bounds.

This error is due to the next line since we cannot index word_i with "[0 +:0]".
off = hpdcache_uint'(word_i[0 +: $clog2(HPDCACHE_ACCESS_WORDS)]);

To solve this compilation error, I would like to propose the following code (it works for Verilator and Questa/Modelsim). Notice that when HPDCACHE_ACCESS_WORDS, the new parameter HPDCACHE_ACCESS_WORDS_LOG2 takes the value 1 to avoid a compilation error in Verilator.

    function automatic hpdcache_data_row_enable_t hpdcache_compute_data_ram_cs( 
            input hpdcache_req_size_t size_i,
            input hpdcache_word_t     word_i);
        localparam int unsigned HPDCACHE_ACCESS_WORDS_LOG2 = (HPDCACHE_ACCESS_WORDS==1) ? 1 : $clog2(HPDCACHE_ACCESS_WORDS);
        hpdcache_data_row_enable_t ret;
        hpdcache_uint32 off;

        case (size_i)
            3'h0,
            3'h1,
            3'h2,
            3'h3:    ret = hpdcache_data_row_enable_t'({1{1'b1}});
            3'h4:    ret = hpdcache_data_row_enable_t'({2{1'b1}});
            3'h5:    ret = hpdcache_data_row_enable_t'({4{1'b1}});
            default: ret = hpdcache_data_row_enable_t'({8{1'b1}});
        endcase

        off = (HPDCACHE_ACCESS_WORDS==1) ? hpdcache_uint'(0) : hpdcache_uint'(word_i[0 +: HPDCACHE_ACCESS_WORDS_LOG2]);
        return hpdcache_data_row_enable_t'(ret << off);      
    endfunction 
  • For the second case, HPDCACHE_ACCESS_WORDS=HPDCACHE_CL_WORDS, the system doesn't work properly since the refill becomes valid before the refill data, like the tag, comes.

Hope this could help.
Thank you,
Noelia.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.