Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DMC to latest tapeout code #584

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Update DMC to latest tapeout code #584

wants to merge 14 commits into from

Conversation

dpetrisko
Copy link
Contributor

This is the version of the DMC which was taped out in TSMC28. Main features from the previous code:

  • Dly line is handled internally with a synthesizable variant
  • Tag configuration is done internally and standardized to a tag structure
  • Added TCALR parameter which allows for period read refreshes to tune the delay line
  • Added trace replay capability for bringup of device

@dpetrisko dpetrisko added the enhancement New feature or request label Sep 10, 2022
@dpetrisko dpetrisko self-assigned this Sep 10, 2022
@dpetrisko
Copy link
Contributor Author

dpetrisko commented Sep 10, 2022

Supercedes #506 #508 #535 #543

@dpetrisko
Copy link
Contributor Author

dpetrisko commented Sep 10, 2022

#387 and #522 are still relevant

@akashnt4
Copy link

akashnt4 commented Mar 10, 2023

@taylor-bsg , @gaozihou ,
The PR is rebased and is on top of master. Simulation is clean and a brief look at the waves looked fine. Request to review and let me know in case of any questions. Thanks!

@dpetrisko
Copy link
Contributor Author

Thanks @akashnt4! I'll take look again as well

@akashnt4
Copy link

Update : #387 is redundant and required changes are updated here.

@akashnt4 akashnt4 self-assigned this Mar 15, 2023
testing/bsg_dmc/testbench.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc.v Outdated Show resolved Hide resolved
testing/bsg_dmc/traffic_generator.v Outdated Show resolved Hide resolved
testing/bsg_dmc/traffic_generator.v Outdated Show resolved Hide resolved
testing/bsg_dmc/bsg_tag_boot_rom.tr Outdated Show resolved Hide resolved
testing/bsg_dmc/bsg_tag_boot_rom.tr Show resolved Hide resolved
Copy link

@akashnt4 akashnt4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update after some review edits.

bsg_cache/bsg_cache_to_dram_ctrl.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc.v Outdated Show resolved Hide resolved
testing/bsg_dmc/bsg_tag_boot_rom.tr Show resolved Hide resolved
testing/bsg_dmc/testbench.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
testing/bsg_dmc/traffic_generator.v Outdated Show resolved Hide resolved
testing/bsg_dmc/Makefile Show resolved Hide resolved
,.reset_i(ui_clk_sync_rst_i)
,.up_i((app_rdy_o & app_en_i))
,.down_i((app_wdf_end_i & app_wdf_rdy_o) || (app_rd_data_end_o))
,.count_o(txn_cnt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This counter underflows in simulation.. Maybe we could increase the max value and add an offset to the init value?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please let me know if the changed vals are okay

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess ui_transaction_in_progress_o is broken?

Also I'd suggest not modifying the cmd_sfifo_depth_p parameter value, it would be better if we could update counter's parameter .max_val_p(2*cmd_sfifo_depth_p)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, had misunderstood the comment. updated now.

bsg_dmc/bsg_dmc_controller.v Outdated Show resolved Hide resolved
app_wdf_data <= wdata >> (ui_data_width_p * i);
app_wdf_mask <= wmask >> (ui_mask_width_lp * i);
if(i==ui_burst_length_p-1) app_wdf_end <= 1'b1;
if(i==ui_burst_length_lp-1) app_wdf_end <= 1'b1;
do @(posedge ui_clk); while(!app_wdf_rdy);
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original testbench only run burst read / write. In order to test intermittent incoming command / data flits, we may add the following lines:

`ifndef CMD_GAP_CYCLES
  `define CMD_GAP_CYCLES 0
`endif

`ifndef WRITE_GAP_CYCLES
  `define WRITE_GAP_CYCLES 0
`endif

For ui_write:

  begin
    for(i=0;i<ui_burst_length_lp;i++) begin
      app_wdf_wren <= 1'b1;
      app_wdf_data <= wdata >> (ui_data_width_p * i);
      app_wdf_mask <= wmask >> (ui_mask_width_lp * i);
      if(i==ui_burst_length_lp-1) app_wdf_end <= 1'b1;
      do @(posedge ui_clk); while(!app_wdf_rdy);
      app_wdf_wren <= 1'b0;
      app_wdf_end <= 1'b0;
      repeat(`WRITE_GAP_CYCLES) @(posedge ui_clk);
    end
  end

For ui_cmd:

  begin
    app_en <= 1'b1;
    app_addr <= addr;
    app_cmd <= cmd;
    do @(posedge ui_clk); while(!app_rdy);
    app_en <= 1'b0;
    repeat(`CMD_GAP_CYCLES) @(posedge ui_clk);
  end

Similar to the frequency sweep, we may add different gap cycle options to the Makefile and test them automatically.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the FPGA clock is going to be always slower than DMC clock, is this not happening already?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on slack chat, add this infra here as we don't know when the UVM testbench will be mainline.

@dpetrisko
Copy link
Contributor Author

Hi @gaozihou , is this good to go / what would be needed to get this merged?

dpetrisko and others added 4 commits June 29, 2024 05:10
commit caa90b7
Author: Dan Petrisko <[email protected]>
Date:   Sun Apr 10 23:29:26 2022 -0700

    Rename to tcalr

commit 522a365
Author: Dan Petrisko <[email protected]>
Date:   Sun Apr 10 22:55:06 2022 -0700

    Cleanup

commit d9d772e
Author: Dan Petrisko <[email protected]>
Date:   Sun Apr 10 22:42:03 2022 -0700

    Fixup rebase

commit 906313d
Author: Dan Petrisko <[email protected]>
Date:   Sun Apr 10 19:14:37 2022 -0700

    Some more cleanup

commit 5ade931
Author: Dan Petrisko <[email protected]>
Date:   Sun Apr 10 18:06:37 2022 -0700

    Moving back to init calib reads

commit 2933a23
Author: Dan Petrisko <[email protected]>
Date:   Fri Apr 8 23:11:09 2022 -0700

    Moving to sipo full

commit fbbac18
Author: Dan Petrisko <[email protected]>
Date:   Fri Apr 8 23:02:22 2022 -0700

    Cleaning up tag name

commit 556f609
Author: Dan Petrisko <[email protected]>
Date:   Wed Apr 6 22:01:21 2022 -0700

    Cleaning zero calr logic

commit 55f0060
Author: Akash Suresh <[email protected]>
Date:   Thu Apr 7 23:53:56 2022 -0700

    adding tag line for periodic_calib_num_reads_todo

commit 73bd6ce
Author: Akash Suresh <[email protected]>
Date:   Wed Apr 6 18:12:09 2022 -0700

    bug fix for arbitrary number of period calibration read count

commit b855711
Author: Akash Suresh <[email protected]>
Date:   Wed Apr 6 17:12:57 2022 -0700

    cleaning up read calibration changes

commit fa40ae4
Author: Akash Suresh <[email protected]>
Date:   Tue Apr 5 23:34:45 2022 -0700

    refactoring periodic reads into CALR instead of LDST; masking at the end of async fifo, instead of sipo for calib reads; other minor edits

commit b9470d5
Author: Akash Suresh <[email protected]>
Date:   Sat Apr 2 19:33:45 2022 -0700

    review edits, change number of calib reads to 2

commit 835f870
Author: Akash Suresh <[email protected]>
Date:   Sun Mar 27 15:59:01 2022 -0700

    adding activate command for initial reads

commit ebd7b48
Author: Akash Suresh <[email protected]>
Date:   Sat Mar 26 16:24:20 2022 -0700

    add CALR state, exit CALR by counting num of completed read operations

commit 07be059
Author: Akash Suresh <[email protected]>
Date:   Fri Mar 11 19:29:07 2022 -0800

    mask initial reads, add tag lines for iniital read count

commit 9cbbe41
Author: Akash Suresh <[email protected]>
Date:   Thu Mar 10 23:12:36 2022 -0800

    read masks for initialisation read calibration

commit 1605086
Author: Akash Suresh <[email protected]>
Date:   Thu Mar 10 22:43:46 2022 -0800

    add read masks for calibration, initial calibration reads

commit 2e1cf78
Author: Akash Suresh <[email protected]>
Date:   Wed Mar 9 20:53:49 2022 -0800

    reset rd_calib_req to 0 upon receiving a regular read command

commit 0ed9777
Author: Akash Suresh <[email protected]>
Date:   Wed Mar 9 20:35:42 2022 -0800

    adding logic for periodic reads for calibration

commit fdb8521
Author: Dan Petrisko <[email protected]>
Date:   Fri Apr 8 23:11:09 2022 -0700

    Moving to sipo full

commit 03d1a1d
Author: Dan Petrisko <[email protected]>
Date:   Wed Apr 6 18:22:05 2022 -0700

    Moving to taps

commit af3beb5
Author: Dan Petrisko <[email protected]>
Date:   Tue Apr 5 15:38:20 2022 -0700

    Moving to external clock with commentary

commit 5b141ef
Author: Dan Petrisko <[email protected]>
Date:   Thu Mar 10 02:19:31 2022 -0800

    DMC fixups

commit c95030e
Author: Dan Petrisko <[email protected]>
Date:   Sun Feb 27 22:38:08 2022 -0800

    Minor fixups

commit 9cb0663
Author: Dan Petrisko <[email protected]>
Date:   Thu Feb 24 00:54:14 2022 -0800

    Adding NOP to command sequences

commit fd144eb
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 17:24:10 2022 -0800

    Gating refresh in progress by valid command

commit dbaa5ff
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 16:45:26 2022 -0800

    Fix for refresh in progress

commit 5be1b29
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 16:43:14 2022 -0800

    Bugfix for transaction counter

commit d76da91
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 06:49:22 2022 -0800

    Renaming

commit 7effe94
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 06:24:54 2022 -0800

    Adding sys tag lines

commit 9802d08
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 04:51:00 2022 -0800

    Tuning delay lines and unparameterizing oscillator properties

commit abf2ef0
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 03:27:39 2022 -0800

    Adjusting trace format for store-forward operation

commit 28a5938
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 01:04:33 2022 -0800

    Fixing up transaction in progress and refresh signals

commit 9640676
Author: Dan Petrisko <[email protected]>
Date:   Wed Feb 23 00:06:15 2022 -0800

    Cleanup tag clients

commit a3cb5dd
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 22 21:14:45 2022 -0800

    fix read trace data width

commit 8f14215
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 22 21:03:37 2022 -0800

    adding fifo for read data path in adapter, struct for wdata trace data

commit a2b4b74
Author: Dan Petrisko <[email protected]>
Date:   Tue Feb 22 17:56:27 2022 -0800

    DQ groups

commit a815340
Author: Dan Petrisko <[email protected]>
Date:   Tue Feb 22 17:40:15 2022 -0800

    Refactor tag clients

commit fc8ac6e
Author: Dan Petrisko <[email protected]>
Date:   Tue Feb 22 17:20:54 2022 -0800

    Rework tags and break out downsampler

commit 9bebb02
Merge: 7dab54a 36abffb
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 22 18:43:03 2022 -0800

    merge with origin

commit 7dab54a
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 22 18:29:47 2022 -0800

    rechecking clock monitor

commit 36abffb
Author: Dan Petrisko <[email protected]>
Date:   Tue Feb 22 16:17:29 2022 -0800

    nits

commit 92cc63e
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 22 00:36:44 2022 -0800

    read path working till trace_replay

commit 8e23aa8
Author: Akash Suresh <[email protected]>
Date:   Mon Feb 21 20:15:10 2022 -0800

    parameterise bsg_dly_line.v, edit control logic for app_en in adapter

commit 6ce7b1e
Author: Akash Suresh <[email protected]>
Date:   Mon Feb 21 16:38:15 2022 -0800

    updating trace conversion logic

commit 30276e6
Merge: 0f3728f 09c27c3
Author: Akash Suresh <[email protected]>
Date:   Mon Feb 21 22:57:05 2022 -0800

    Merge branch 'dmc_bringup' of https://github.com/akashnt4/basejump_stl into dmc_bringup

commit 09c27c3
Author: Akash Suresh <[email protected]>
Date:   Mon Feb 21 14:12:10 2022 -0800

    refactoring tag lines

commit 48e63a5
Author: Akash Suresh <[email protected]>
Date:   Fri Feb 18 12:32:25 2022 -0800

    addressing review comments part-2

commit 1047a0b
Author: Akash Suresh <[email protected]>
Date:   Mon Feb 14 19:19:08 2022 -0800

    addressing review comments part-1

commit f64ae29
Merge: 3d417b7 805e8fa
Author: Akash Suresh <[email protected]>
Date:   Mon Feb 14 17:44:02 2022 -0800

    Merge branch 'dmc_bringup' of https://github.com/akashnt4/basejump_stl into dmc_bringup

commit 805e8fa
Author: Akash S <[email protected]>
Date:   Fri Feb 11 22:25:15 2022 -0800

    Delete bsg_tag_boot_rom.v

    deleting generated file

commit 8d3a632
Author: Akash S <[email protected]>
Date:   Fri Feb 11 22:23:06 2022 -0800

    Delete bsg_dmc_trace_rom.v

    deleting generated file

commit 755f093
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 8 23:03:30 2022 -0800

    adding clk monitor downsample tag lines and some refactoring

commit 79e5a53
Author: Akash Suresh <[email protected]>
Date:   Tue Feb 8 00:05:29 2022 -0800

    addressing review comments except for read during clock switch

commit 053c4a0
Author: Akash Suresh <[email protected]>
Date:   Sun Feb 6 22:35:37 2022 -0800

    clock monitor integrated into dmc TB

commit 0856320
Author: Akash Suresh <[email protected]>
Date:   Sun Jan 30 21:57:41 2022 -0800

    generate dfi_2x clk of correct frequency

commit 9a7fac8
Author: Akash Suresh <[email protected]>
Date:   Sat Jan 29 22:00:21 2022 -0800

    generating oscillator clock

commit d726078
Author: Akash Suresh <[email protected]>
Date:   Tue Jan 25 22:53:36 2022 -0800

    adding tag support for stall in unit TB

commit 528d12f
Author: Akash Suresh <[email protected]>
Date:   Mon Jan 24 20:07:29 2022 -0800

    logic for stalling and refresh_in_progress intimation

commit 1473c7f
Author: Akash Suresh <[email protected]>
Date:   Sat Jan 15 22:05:21 2022 -0800

    adding make jobs for python to rom.v translation

commit c4cd219
Author: Akash Suresh <[email protected]>
Date:   Sat Jan 15 21:50:25 2022 -0800

    both write and read paths integrated till fpga links

commit 32395e6
Author: Akash Suresh <[email protected]>
Date:   Wed Jan 12 21:05:40 2022 -0800

    write path integrated with the adapter infra

commit b4a8794
Merge: bfbd352 8345b28
Author: Akash Suresh <[email protected]>
Date:   Mon Jan 10 19:28:05 2022 -0800

    resolve merge errors

commit 8345b28
Author: Akash Suresh <[email protected]>
Date:   Mon Jan 10 15:38:43 2022 -0800

    dmc initialisation review fixes

commit 684bac2
Author: Akash Suresh <[email protected]>
Date:   Sat Jan 8 22:48:30 2022 -0800

    rebasing to latest master

commit c15867f
Author: zhaochun <[email protected]>
Date:   Mon Jan 18 13:08:38 2021 -0800

    Fixing typo

commit 2fd6919
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:24:40 2021 -0800

    Adding tag trace file and updating Makefile

commit 1d8ae59
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:24:00 2021 -0800

    Updating simulation filelist

commit 8134e38
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:23:30 2021 -0800

    Moving configuration and traffic generation logic into a separate module of traffic_generator

commit deedfbf
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:21:14 2021 -0800

    Updating the behavioral model for bsg_dly_line and making it consistent with implementation

commit bfbd352
Author: Akash Suresh <[email protected]>
Date:   Sat Jan 8 22:14:05 2022 -0800

    revert some commented code

commit 7364335
Author: Akash Suresh <[email protected]>
Date:   Sat Jan 8 20:56:59 2022 -0800

    dmc bringup adapter: write working

commit 27a2ed7
Author: Akash Suresh <[email protected]>
Date:   Thu Jan 6 17:19:38 2022 -0800

    tester first cut

commit 8b19ee7
Author: Akash Suresh <[email protected]>
Date:   Thu Dec 30 10:43:03 2021 -0800

    prelim edits to traffic_gen

commit 4ec01e5
Author: zhaochun <[email protected]>
Date:   Mon Jan 18 13:08:38 2021 -0800

    Fixing typo

commit e64efae
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:24:40 2021 -0800

    Adding tag trace file and updating Makefile

commit 0477801
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:24:00 2021 -0800

    Updating simulation filelist

commit ba27ea4
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:23:30 2021 -0800

    Moving configuration and traffic generation logic into a separate module of traffic_generator

commit 2e474f7
Author: zhaochun <[email protected]>
Date:   Mon Jan 11 13:21:14 2021 -0800

    Updating the behavioral model for bsg_dly_line and making it consistent with implementation
@dpetrisko
Copy link
Contributor Author

Just rebased by the way!

dpetrisko pushed a commit that referenced this pull request Jun 29, 2024
dpetrisko pushed a commit that referenced this pull request Jun 29, 2024
dpetrisko pushed a commit that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants