Add files using upload-large-folder tool
Browse files- snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/master_calib_skip/bsg_comm_link_master_calib_skip_rom.trace.in +101 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/master_calib_skip/bsg_source_sync_channel_control_master_master.sv +88 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_assembler/test_bsg_assembler.sv +530 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_comm_link/test_bsg_comm_link.sv +307 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_source_sync/Makefile +27 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_source_sync/test_bsg_source_sync.sv +343 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/fakeram/bsg_mem_1rw_sync_macros.svh +24 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/fakeram/bsg_mem_1rw_sync_mask_write_bit_macros.svh +24 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/fakeram/bsg_mem_1rw_sync_mask_write_byte_macros.svh +32 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/gf_14/README.md +17 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_async/bsg_launch_sync_sync.sv +170 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_async/bsg_sync_sync.sv +90 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1r1w_sync_mask_write_bit.sv +132 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1rw_sync.sv +108 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1rw_sync_mask_write_bit.sv +97 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1rw_sync_mask_write_byte.sv +65 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_2r1w_sync.sv +122 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_misc/bsg_level_shift_up_down_sink.sv +32 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_misc/bsg_level_shift_up_down_source.sv +32 -0
- snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_misc/bsg_mux.sv +45 -0
snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/master_calib_skip/bsg_comm_link_master_calib_skip_rom.trace.in
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#######################################################################################################
|
| 2 |
+
#
|
| 3 |
+
#
|
| 4 |
+
# trace (for bsg_fsb_node_trace_replay) to have the master do a quick wakeup of the ASIC comm link
|
| 5 |
+
#
|
| 6 |
+
#
|
| 7 |
+
# format: <4 bit op> <16 bits>
|
| 8 |
+
# op = 0000: wait one cycle
|
| 9 |
+
# op = 0001: write data <addr2 data14>
|
| 10 |
+
# 00 data14 --> write channel <valid1, data8> reg
|
| 11 |
+
# 01 data14 --> write channel override reg <1bit>
|
| 12 |
+
# 10 data14 --> write master_master test_pass_reg <6bit>
|
| 13 |
+
# 11 data14 --> write match_reg < out_calib_prep1, out_calibration_state3 >
|
| 14 |
+
# op = 0010: 00_0000_0000_0000 --> wait until match reg matches < out_calib_prep1, out_calibration_state6 >
|
| 15 |
+
# (check data)
|
| 16 |
+
#
|
| 17 |
+
# op = 0011: done; disable but do not stop
|
| 18 |
+
# op = 0100: call $finish
|
| 19 |
+
# op = 0101: cycle counter decrement and wait
|
| 20 |
+
# op = 0110 initialize cycle counter with 16 bits
|
| 21 |
+
#
|
| 22 |
+
#
|
| 23 |
+
# op4 adr2 field
|
| 24 |
+
#
|
| 25 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8
|
| 26 |
+
# 0001__01___00_0000_0000_000R # --> channel write override reg 1bit
|
| 27 |
+
# 0001__10___00_0000_00PP_PPPP # --> channel write master_master test_pass_reg
|
| 28 |
+
# 0001__11___00_0000_0000_PMMM # --> channel write prep1, calib_state3 match reg
|
| 29 |
+
# 0010__0000_0000_0000_0000 # --> wait for match reg to match
|
| 30 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles
|
| 31 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter
|
| 32 |
+
# 0011__0000_0000_0000_0000 # --> stop
|
| 33 |
+
#
|
| 34 |
+
#
|
| 35 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8 (0,F5 == reset clock)
|
| 36 |
+
0001__00___00_0000_1111_0101
|
| 37 |
+
# 0001__01___00_0000_0000_000R # --> channel write override reg 1bit (1 = override)
|
| 38 |
+
0001__01___00_0000_0000_0001
|
| 39 |
+
# 0001__11___00_0000_0000_PMMM # --> channel write prep1, calib_state3 match reg wait for (prep=1,state=000)
|
| 40 |
+
0001__11___00_0000_0000_1000
|
| 41 |
+
# 0010__0000_0000_0000_0000 # --> wait for match reg to match (wait for prep=1)
|
| 42 |
+
0010__0000_0000_0000_0000
|
| 43 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 44 |
+
0110__0000_0000_0010_0000
|
| 45 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 46 |
+
0101__0000_0000_0000_0000
|
| 47 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8 (1,81 == reset token)
|
| 48 |
+
0001__00___00_0001_1000_0001
|
| 49 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 50 |
+
0110__0000_0000_0010_0000
|
| 51 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 52 |
+
0101__0000_0000_0000_0000
|
| 53 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8 (0,F5 == reset clock)
|
| 54 |
+
0001__00___00_0000_1111_0101
|
| 55 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 64 cycles) extra time for token CDC
|
| 56 |
+
0110__0000_0000_0100_0000
|
| 57 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 64 cycles)
|
| 58 |
+
0101__0000_0000_0000_0000
|
| 59 |
+
# 0001__10___00_0000_00PP_PPPP # --> channel write master_master test_pass_reg (passed test 1), turn reset low
|
| 60 |
+
0001__10___00_0000_0000_0001
|
| 61 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 62 |
+
0110__0000_0000_0010_0000
|
| 63 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 64 |
+
0101__0000_0000_0000_0000
|
| 65 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8 (0,6A == activate channel)
|
| 66 |
+
0001__00___00_0000_0110_1010
|
| 67 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 68 |
+
0110__0000_0000_0010_0000
|
| 69 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 70 |
+
0101__0000_0000_0000_0000
|
| 71 |
+
# 0001__10___00_0000_00PP_PPPP # --> channel write master_master test_pass_reg (passed test 2), turn reset high
|
| 72 |
+
0001__10___00_0000_0000_0010
|
| 73 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 74 |
+
0110__0000_0000_0010_0000
|
| 75 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 76 |
+
0101__0000_0000_0000_0000
|
| 77 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8 (1,81 == reset token)
|
| 78 |
+
0001__00___00_0001_1000_0001
|
| 79 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 80 |
+
0110__0000_0000_0010_0000
|
| 81 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 82 |
+
0101__0000_0000_0000_0000
|
| 83 |
+
# 0001__00___00_000V_DDDD_DDDD # --> channel write valid1,data8 (0,6A == activate channel)
|
| 84 |
+
0001__00___00_0000_0110_1010
|
| 85 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 64 cycles) extra time for token CDC
|
| 86 |
+
0110__0000_0000_0100_0000
|
| 87 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 64 cycles)
|
| 88 |
+
0101__0000_0000_0000_0000
|
| 89 |
+
# 0001__10___00_0000_00PP_PPPP # --> channel write master_master test_pass_reg (passed test 3), turn reset low
|
| 90 |
+
0001__10___00_0000_0000_0100
|
| 91 |
+
# 0110__CCCC_CCCC_CCCC_CCCC # --> initialize cycle counter to C cycles (init 32 cycles)
|
| 92 |
+
0110__0000_0000_0010_0000
|
| 93 |
+
# 0101__0000_0000_0000_0000 # --> decrement and wait on cycle counter (wait 32 cycles)
|
| 94 |
+
0101__0000_0000_0000_0000
|
| 95 |
+
# 0001__01___00_0000_0000_000R # --> channel write override reg 1bit disable override of output (0 = override)
|
| 96 |
+
0001__01___00_0000_0000_0000
|
| 97 |
+
# 0001__10___00_0000_00PP_PPPP # --> channel write master_master test_pass_reg (passed test 6), activate channel
|
| 98 |
+
0001__10___00_0000_0011_1111
|
| 99 |
+
# 0011__0000_0000_0000_0000 # --> stop script
|
| 100 |
+
0011__0000_0000_0000_0000
|
| 101 |
+
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/master_calib_skip/bsg_source_sync_channel_control_master_master.sv
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// MBT 5-1-2017
|
| 2 |
+
//
|
| 3 |
+
// fast version of the gateway reset sequence
|
| 4 |
+
//
|
| 5 |
+
// this version assumes that all channels work
|
| 6 |
+
// and is just for gatelevel simulation.
|
| 7 |
+
//
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
`include "bsg_defines.sv"
|
| 11 |
+
|
| 12 |
+
module bsg_source_sync_channel_control_master_master
|
| 13 |
+
#(parameter `BSG_INV_PARAM( link_channels_p )
|
| 14 |
+
, parameter `BSG_INV_PARAM(tests_p )
|
| 15 |
+
, parameter `BSG_INV_PARAM(prepare_cycles_p ) // ignored
|
| 16 |
+
, parameter `BSG_INV_PARAM(timeout_cycles_p )) // ignored
|
| 17 |
+
(input clk_i // from io_master_clk_i
|
| 18 |
+
, input reset_i // from im_reset_i
|
| 19 |
+
|
| 20 |
+
// we should begin the calibration stuff
|
| 21 |
+
|
| 22 |
+
, input start_i
|
| 23 |
+
|
| 24 |
+
// from masters, signals that that channel thinks it is done with the test
|
| 25 |
+
|
| 26 |
+
, input [tests_p+1-1:0][link_channels_p-1:0] test_scoreboard_i
|
| 27 |
+
, output [$clog2(tests_p+1)-1:0] test_index_r_o
|
| 28 |
+
|
| 29 |
+
// simultaneously a reset signal and a signal to the masters
|
| 30 |
+
|
| 31 |
+
, output prepare_o
|
| 32 |
+
, output done_o // we are done with all of this calibration stuff.
|
| 33 |
+
);
|
| 34 |
+
|
| 35 |
+
logic done_r, done_n;
|
| 36 |
+
|
| 37 |
+
logic [$clog2(tests_p+1)-1:0] test_index_n, test_index_r;
|
| 38 |
+
assign test_index_r_o = test_index_r;
|
| 39 |
+
|
| 40 |
+
logic started_r;
|
| 41 |
+
|
| 42 |
+
always_ff @(posedge clk_i)
|
| 43 |
+
if (reset_i)
|
| 44 |
+
started_r <= 0;
|
| 45 |
+
else
|
| 46 |
+
started_r <= started_r | start_i;
|
| 47 |
+
|
| 48 |
+
// we assert reset on states that end in 0
|
| 49 |
+
|
| 50 |
+
assign prepare_o = ~(test_index_r[0]) & started_r & ~done_r;
|
| 51 |
+
|
| 52 |
+
always_ff @(posedge clk_i)
|
| 53 |
+
begin
|
| 54 |
+
if (reset_i)
|
| 55 |
+
test_index_r <= 0;
|
| 56 |
+
else
|
| 57 |
+
test_index_r <= test_index_n;
|
| 58 |
+
end
|
| 59 |
+
|
| 60 |
+
assign done_o = done_r;
|
| 61 |
+
|
| 62 |
+
always @(posedge clk_i)
|
| 63 |
+
if (reset_i)
|
| 64 |
+
done_r <= 0;
|
| 65 |
+
else
|
| 66 |
+
done_r <= done_n;
|
| 67 |
+
|
| 68 |
+
always_comb
|
| 69 |
+
begin
|
| 70 |
+
done_n = done_r;
|
| 71 |
+
if (&test_scoreboard_i[tests_p])
|
| 72 |
+
done_n = 1'b1;
|
| 73 |
+
end
|
| 74 |
+
|
| 75 |
+
// move to the next test if everybody is happy
|
| 76 |
+
|
| 77 |
+
always_comb
|
| 78 |
+
begin
|
| 79 |
+
test_index_n = test_index_r;
|
| 80 |
+
|
| 81 |
+
if (!done_r & started_r & (&test_scoreboard_i[test_index_r]))
|
| 82 |
+
test_index_n = test_index_r+1;
|
| 83 |
+
end
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
endmodule
|
| 87 |
+
|
| 88 |
+
`BSG_ABSTRACT_MODULE(bsg_source_sync_channel_control_master_master)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_assembler/test_bsg_assembler.sv
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// MBT 8-20-2014
|
| 2 |
+
//
|
| 3 |
+
// Test assembler
|
| 4 |
+
//
|
| 5 |
+
// We model here two cores that have different clocks and are
|
| 6 |
+
// communicating over an I/O channel which has a third clock.
|
| 7 |
+
//
|
| 8 |
+
// Includes model reset logic with synchronizers and delayed
|
| 9 |
+
// communication after reset.
|
| 10 |
+
//
|
| 11 |
+
|
| 12 |
+
// these defines can be overridden by command line parameters
|
| 13 |
+
|
| 14 |
+
`include "bsg_defines.sv"
|
| 15 |
+
|
| 16 |
+
`include "test_assembler_defines.sv"
|
| 17 |
+
|
| 18 |
+
module test_assembler;
|
| 19 |
+
|
| 20 |
+
initial begin
|
| 21 |
+
$vcdpluson;
|
| 22 |
+
$vcdplusmemon;
|
| 23 |
+
end
|
| 24 |
+
|
| 25 |
+
// three separate clocks: I/O, and the two cores communicating with each other
|
| 26 |
+
localparam core_0_half_period_lp = `CORE_0_HALF_PERIOD;
|
| 27 |
+
localparam io_master_half_period_lp = `IO_MASTER_HALF_PERIOD;
|
| 28 |
+
localparam core_1_half_period_lp = `CORE_1_HALF_PERIOD;
|
| 29 |
+
|
| 30 |
+
localparam iterations_lp = `ITERATIONS;
|
| 31 |
+
|
| 32 |
+
// number of bits width of a channel
|
| 33 |
+
localparam channel_width_lp = `CHANNEL_WIDTH;
|
| 34 |
+
localparam num_channels_lp = `NUM_CHANNELS;
|
| 35 |
+
|
| 36 |
+
// this is the number of bytes that a ring packet is
|
| 37 |
+
localparam ring_bytes_lp = `RING_BYTES;
|
| 38 |
+
|
| 39 |
+
// across all frequency combinations, we need a little over 20 fifo slots
|
| 40 |
+
// so we round up to 32, to allow for delay in the FPGA
|
| 41 |
+
|
| 42 |
+
localparam lg_input_fifo_depth_lp = 5;
|
| 43 |
+
|
| 44 |
+
// for DDR at 500 mbps, we make token go at / 8 = 66 mbps
|
| 45 |
+
// this will keep the token clock nice and slow
|
| 46 |
+
|
| 47 |
+
localparam lg_credit_to_token_decimation_lp=3;
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
// *************************************************
|
| 52 |
+
// independent clocks
|
| 53 |
+
//
|
| 54 |
+
//
|
| 55 |
+
|
| 56 |
+
logic core_0_clk, core_1_clk, io_master_clk;
|
| 57 |
+
|
| 58 |
+
initial core_0_clk = 0;
|
| 59 |
+
always #(core_0_half_period_lp) core_0_clk = ~core_0_clk;
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
initial io_master_clk = 0;
|
| 63 |
+
always #(io_master_half_period_lp) io_master_clk = ~io_master_clk;
|
| 64 |
+
|
| 65 |
+
initial core_1_clk = 0;
|
| 66 |
+
always #(core_1_half_period_lp) core_1_clk = ~core_1_clk;
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
// *************************************************
|
| 70 |
+
// master resets
|
| 71 |
+
//
|
| 72 |
+
|
| 73 |
+
logic core_0_reset, core_1_reset;
|
| 74 |
+
|
| 75 |
+
localparam core_reset_cycles_hi_lp = 256;
|
| 76 |
+
localparam core_reset_cycles_lo_lp = 16;
|
| 77 |
+
|
| 78 |
+
// we model this as if the FPGA is driving this with an unknown clock.
|
| 79 |
+
initial
|
| 80 |
+
begin
|
| 81 |
+
core_0_reset = 0;
|
| 82 |
+
core_1_reset = 0;
|
| 83 |
+
// simple hack to wait based on maximum of clock periods
|
| 84 |
+
repeat (core_reset_cycles_lo_lp)
|
| 85 |
+
begin
|
| 86 |
+
@(negedge core_0_clk);
|
| 87 |
+
@(negedge core_1_clk);
|
| 88 |
+
@(negedge io_master_clk);
|
| 89 |
+
end
|
| 90 |
+
|
| 91 |
+
core_0_reset = 1;
|
| 92 |
+
core_1_reset = 1;
|
| 93 |
+
// simple hack to wait based on maximum of clock periods
|
| 94 |
+
repeat (core_reset_cycles_hi_lp)
|
| 95 |
+
begin
|
| 96 |
+
@(negedge core_0_clk);
|
| 97 |
+
@(negedge core_1_clk);
|
| 98 |
+
@(negedge io_master_clk);
|
| 99 |
+
end
|
| 100 |
+
|
| 101 |
+
core_0_reset = 0;
|
| 102 |
+
core_1_reset = 0;
|
| 103 |
+
|
| 104 |
+
$display("__________ ___________ _______________________________");
|
| 105 |
+
$display("\\______ \\\\_ _____/ / _____/\\_ _____/\\__ ___/");
|
| 106 |
+
$display(" | _/ | __)_ \\_____ \\ | __)_ | | ");
|
| 107 |
+
$display(" | | \\ | \\ / \\ | \\ | | ");
|
| 108 |
+
$display(" |____|_ //_______ //_______ //_______ / |____| ");
|
| 109 |
+
$display(" \\/ \\/ \\/ \\/ ");
|
| 110 |
+
end
|
| 111 |
+
|
| 112 |
+
//**********************************************************************
|
| 113 |
+
// CORE 0 (sender)
|
| 114 |
+
// ______ _____ ______ _______ _______ _______ ______ _____
|
| 115 |
+
// / _____) ___ \(_____ \(_______) (_______|_______|_____ \ / ___ \
|
| 116 |
+
// | / | | | |_____) )_____ __ _____ _____) ) | | |
|
| 117 |
+
// | | | | | (_____ (| ___) / / | ___) (_____ (| | | |
|
| 118 |
+
// | \____| |___| | | | |_____ / /____| |_____ | | |___| |
|
| 119 |
+
// \______)_____/ |_|_______) (_______)_______) |_|\_____/
|
| 120 |
+
//
|
| 121 |
+
//**********************************************************************
|
| 122 |
+
|
| 123 |
+
wire core_0_reset_sync, io_master_reset_sync, token_reset_sync;
|
| 124 |
+
|
| 125 |
+
// reset synchronizer: core clock reset
|
| 126 |
+
bsg_sync_sync #(.width_p(1)) bss_core_reset
|
| 127 |
+
(.oclk_i(core_0_clk)
|
| 128 |
+
,.iclk_data_i(core_0_reset)
|
| 129 |
+
,.oclk_data_o(core_0_reset_sync)
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
// reset synchronizer: master clock reset
|
| 133 |
+
bsg_sync_sync #(.width_p(1)) bss_io_master_reset
|
| 134 |
+
(.oclk_i(io_master_clk)
|
| 135 |
+
,.iclk_data_i(core_0_reset)
|
| 136 |
+
,.oclk_data_o(io_master_reset_sync)
|
| 137 |
+
);
|
| 138 |
+
|
| 139 |
+
// reset synchronizer: token reset
|
| 140 |
+
bsg_sync_sync #(.width_p(1)) bss_token_reset
|
| 141 |
+
(.oclk_i(io_master_clk)
|
| 142 |
+
,.iclk_data_i(core_0_reset)
|
| 143 |
+
,.oclk_data_o(token_reset_sync)
|
| 144 |
+
);
|
| 145 |
+
|
| 146 |
+
logic [channel_width_lp-1:0] core_0_data_r;
|
| 147 |
+
logic core_0_valid_r;
|
| 148 |
+
|
| 149 |
+
// wait a certain number of cycles after reset before restarting
|
| 150 |
+
localparam lg_wait_cycles_activate_lp = 4;
|
| 151 |
+
wire core_reset_ready;
|
| 152 |
+
|
| 153 |
+
bsg_wait_after_reset #(.lg_wait_cycles_p(lg_wait_cycles_activate_lp)) bwar
|
| 154 |
+
(.reset_i(core_0_reset_sync)
|
| 155 |
+
,.clk_i(core_0_clk)
|
| 156 |
+
,.ready_r_o(core_reset_ready)
|
| 157 |
+
);
|
| 158 |
+
|
| 159 |
+
// only start sending after a certain number of cycles
|
| 160 |
+
assign core_0_valid_r = core_reset_ready;
|
| 161 |
+
|
| 162 |
+
wire core_0_assembler_ready;
|
| 163 |
+
wire core_0_yumi = core_0_assembler_ready & core_0_valid_r;
|
| 164 |
+
|
| 165 |
+
// transmit sequence of data values
|
| 166 |
+
always @(posedge core_0_clk)
|
| 167 |
+
if (core_0_reset_sync)
|
| 168 |
+
core_0_data_r <= 0;
|
| 169 |
+
else
|
| 170 |
+
if (core_0_yumi)
|
| 171 |
+
core_0_data_r <= core_0_data_r + 1;
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
// ***********************************************
|
| 175 |
+
// TOKEN RESET LOGIC
|
| 176 |
+
//
|
| 177 |
+
// reset logic for clearing output channel's
|
| 178 |
+
// token-clocked logic.
|
| 179 |
+
//
|
| 180 |
+
|
| 181 |
+
logic io_override_en;
|
| 182 |
+
logic [channel_width_lp+1-1:0] io_override_valid_data;
|
| 183 |
+
logic io_master_reset_sync_r;
|
| 184 |
+
logic [10:0] io_reset_counter_r;
|
| 185 |
+
|
| 186 |
+
always @(posedge io_master_clk)
|
| 187 |
+
begin
|
| 188 |
+
io_master_reset_sync_r <= io_master_reset_sync;
|
| 189 |
+
|
| 190 |
+
// on positive edge of reset, we initialize the counter
|
| 191 |
+
// the counter continuously counts during reset
|
| 192 |
+
// and is zero'd when not in reset
|
| 193 |
+
if (io_master_reset_sync)
|
| 194 |
+
begin
|
| 195 |
+
if (~io_master_reset_sync_r)
|
| 196 |
+
io_reset_counter_r <= 1;
|
| 197 |
+
else
|
| 198 |
+
io_reset_counter_r <= io_reset_counter_r + 1;
|
| 199 |
+
end
|
| 200 |
+
else
|
| 201 |
+
io_reset_counter_r <= 0;
|
| 202 |
+
end
|
| 203 |
+
|
| 204 |
+
// this asserts the override data while the reset counter
|
| 205 |
+
// is in its active portion
|
| 206 |
+
|
| 207 |
+
always_comb
|
| 208 |
+
begin
|
| 209 |
+
io_override_en = io_master_reset_sync;
|
| 210 |
+
io_override_valid_data = { 0'b0, 0'h00 };
|
| 211 |
+
|
| 212 |
+
// for 2^6 cycles, assert the "token reset code"
|
| 213 |
+
if (io_reset_counter_r[10:6] == 5'b00001)
|
| 214 |
+
io_override_valid_data = { 1'b1, 8'h80 };
|
| 215 |
+
end
|
| 216 |
+
|
| 217 |
+
// entertainingly, we need to label both sides
|
| 218 |
+
// of the if statement the same thing in order
|
| 219 |
+
// to have the variable top_active_channel
|
| 220 |
+
// resolve later in the file (to xkr.top_active_channel)
|
| 221 |
+
if (num_channels_lp < 2)
|
| 222 |
+
begin: xkr
|
| 223 |
+
wire top_active_channel = 1'b0;
|
| 224 |
+
end
|
| 225 |
+
else
|
| 226 |
+
begin: xkr
|
| 227 |
+
wire [$clog2(num_channels_lp)-1:0] top_active_channel
|
| 228 |
+
= $clog2(num_channels_lp)' (num_channels_lp-1'b1);
|
| 229 |
+
end
|
| 230 |
+
|
| 231 |
+
genvar i;
|
| 232 |
+
|
| 233 |
+
wire [channel_width_lp-1:0] core_0_send_data [ring_bytes_lp-1:0];
|
| 234 |
+
|
| 235 |
+
localparam lg_ring_bytes_lp = $clog2(ring_bytes_lp);
|
| 236 |
+
|
| 237 |
+
wire [$max(lg_ring_bytes_lp-1,0):0] ring_bytes
|
| 238 |
+
= $max(lg_ring_bytes_lp,1) ' (ring_bytes_lp);
|
| 239 |
+
|
| 240 |
+
if (ring_bytes_lp > 1)
|
| 241 |
+
for (i = 0; i < ring_bytes_lp; i++)
|
| 242 |
+
begin
|
| 243 |
+
wire [lg_ring_bytes_lp-1:0] my_id = i[lg_ring_bytes_lp-1:0];
|
| 244 |
+
assign core_0_send_data[i]
|
| 245 |
+
= { my_id, core_0_data_r[0+:channel_width_lp-lg_ring_bytes_lp]};
|
| 246 |
+
end
|
| 247 |
+
else
|
| 248 |
+
assign core_0_send_data[0] = core_0_data_r;
|
| 249 |
+
|
| 250 |
+
// ***********************************************
|
| 251 |
+
//
|
| 252 |
+
// out assembler
|
| 253 |
+
//
|
| 254 |
+
//
|
| 255 |
+
|
| 256 |
+
wire [num_channels_lp-1:0] channel_valids;
|
| 257 |
+
wire [num_channels_lp-1:0] channel_readys;
|
| 258 |
+
wire [channel_width_lp-1:0] channel_datas [num_channels_lp-1:0];
|
| 259 |
+
|
| 260 |
+
// de-bond channel into multiple individual channels
|
| 261 |
+
bsg_assembler_out #(.width_p(channel_width_lp)
|
| 262 |
+
,.num_in_p(ring_bytes_lp)
|
| 263 |
+
,.num_out_p(num_channels_lp)
|
| 264 |
+
,.out_channel_count_mask_p(1 << (num_channels_lp-1)) // fixme
|
| 265 |
+
) bao
|
| 266 |
+
(.clk(core_0_clk)
|
| 267 |
+
,.reset(core_0_reset_sync)
|
| 268 |
+
,.valid_i(core_0_valid_r)
|
| 269 |
+
,.data_i(core_0_send_data )
|
| 270 |
+
,.ready_o(core_0_assembler_ready)
|
| 271 |
+
|
| 272 |
+
,.in_top_channel_i(ring_bytes-1'b1)
|
| 273 |
+
,.out_top_channel_i(xkr.top_active_channel)
|
| 274 |
+
|
| 275 |
+
,.valid_o(channel_valids)
|
| 276 |
+
,.data_o( channel_datas)
|
| 277 |
+
,.ready_i(channel_readys)
|
| 278 |
+
);
|
| 279 |
+
|
| 280 |
+
// ***********************************************
|
| 281 |
+
// declare signals going out over transmission lines
|
| 282 |
+
// between input and output channel
|
| 283 |
+
//
|
| 284 |
+
|
| 285 |
+
wire [num_channels_lp-1:0] io_clk_tline, io_valid_tline;
|
| 286 |
+
wire [channel_width_lp-1:0] io_data_tline [num_channels_lp-1:0];
|
| 287 |
+
wire [num_channels_lp-1:0] token_clk_tline;
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
// create a bunch of channels
|
| 291 |
+
for (i = 0; i < num_channels_lp; i=i+1)
|
| 292 |
+
begin: bsso
|
| 293 |
+
bsg_source_sync_output
|
| 294 |
+
#(.lg_start_credits_p(lg_input_fifo_depth_lp)
|
| 295 |
+
,.lg_credit_to_token_decimation_p(lg_credit_to_token_decimation_lp)
|
| 296 |
+
,.channel_width_p(channel_width_lp)
|
| 297 |
+
) bsso
|
| 298 |
+
(.core_clk_i(core_0_clk)
|
| 299 |
+
,.core_reset_i(core_0_reset_sync)
|
| 300 |
+
|
| 301 |
+
// core 0 side logical signals
|
| 302 |
+
,.core_data_i(channel_datas[i])
|
| 303 |
+
,.core_valid_i(channel_valids[i])
|
| 304 |
+
,.core_ready_o(channel_readys[i])
|
| 305 |
+
|
| 306 |
+
,.io_master_clk_i(io_master_clk)
|
| 307 |
+
,.io_reset_i(io_master_reset_sync)
|
| 308 |
+
|
| 309 |
+
,.io_override_en_i(io_override_en)
|
| 310 |
+
,.io_override_valid_data_i(io_override_valid_data)
|
| 311 |
+
|
| 312 |
+
,.io_clk_r_o(io_clk_tline[i]) // output to other node
|
| 313 |
+
,.io_data_r_o(io_data_tline[i]) // output to other node
|
| 314 |
+
,.io_valid_r_o(io_valid_tline[i]) // output to other node
|
| 315 |
+
|
| 316 |
+
,.token_clk_i(token_clk_tline[i]) // input from other node
|
| 317 |
+
// from core 0 // fixme is this signal correctly named?
|
| 318 |
+
,.token_reset_i(token_reset_sync)
|
| 319 |
+
);
|
| 320 |
+
|
| 321 |
+
end
|
| 322 |
+
|
| 323 |
+
//************************************************************
|
| 324 |
+
// CORE 1 (input side)
|
| 325 |
+
// ______ _____ ______ _______ _____ ______ _______
|
| 326 |
+
// / _____) ___ \(_____ \(_______) / ___ \| ___ \(_______)
|
| 327 |
+
// | / | | | |_____) )_____ | | | | | | |_____
|
| 328 |
+
// | | | | | (_____ (| ___) | | | | | | | ___)
|
| 329 |
+
// | \____| |___| | | | |_____ | |___| | | | | |_____
|
| 330 |
+
// \______)_____/ |_|_______) \_____/|_| |_|_______)
|
| 331 |
+
//
|
| 332 |
+
//************************************************************
|
| 333 |
+
|
| 334 |
+
localparam lg_io_delay_reset_lp = 6;
|
| 335 |
+
|
| 336 |
+
wire [num_channels_lp-1:0] io_1_reset_sync;
|
| 337 |
+
wire core_1_reset_sync;
|
| 338 |
+
|
| 339 |
+
bsg_sync_sync #(.width_p(1)) bss_core_1_reset
|
| 340 |
+
(.oclk_i(core_1_clk)
|
| 341 |
+
,.iclk_data_i(core_1_reset)
|
| 342 |
+
,.oclk_data_o(core_1_reset_sync)
|
| 343 |
+
);
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
wire [num_channels_lp-1:0] core_1_assembler_yumi;
|
| 347 |
+
wire [num_channels_lp-1:0] core_1_assembler_valid;
|
| 348 |
+
wire [channel_width_lp-1:0] core_1_assembler_data [num_channels_lp-1:0];
|
| 349 |
+
|
| 350 |
+
// merged channel
|
| 351 |
+
wire core_1_valid, core_1_yumi;
|
| 352 |
+
wire [channel_width_lp*ring_bytes_lp-1:0] core_1_data;
|
| 353 |
+
|
| 354 |
+
// create a bunch of channels
|
| 355 |
+
for (i = 0; i < num_channels_lp; i=i+1)
|
| 356 |
+
begin
|
| 357 |
+
bsg_sync_sync #(.width_p(1)) bss_io_1_reset
|
| 358 |
+
(.oclk_i(io_clk_tline[i])
|
| 359 |
+
,.iclk_data_i(core_1_reset)
|
| 360 |
+
,.oclk_data_o(io_1_reset_sync[i])
|
| 361 |
+
);
|
| 362 |
+
|
| 363 |
+
bsg_source_sync_input
|
| 364 |
+
#(.lg_fifo_depth_p(lg_input_fifo_depth_lp)
|
| 365 |
+
,.lg_credit_to_token_decimation_p(lg_credit_to_token_decimation_lp)
|
| 366 |
+
,.channel_width_p(channel_width_lp)
|
| 367 |
+
) bssi
|
| 368 |
+
(.io_clk_i(io_clk_tline[i]) // input from other node; starts on reset
|
| 369 |
+
,.io_reset_i(io_1_reset_sync[i])
|
| 370 |
+
,.io_data_i(io_data_tline[i]) // input from other node
|
| 371 |
+
,.io_valid_i(io_valid_tline[i]) // input from other node
|
| 372 |
+
|
| 373 |
+
,.io_edge_i(2'b11) // latch on both edges
|
| 374 |
+
|
| 375 |
+
,.io_token_r_o(token_clk_tline[i]) // output to other node
|
| 376 |
+
|
| 377 |
+
,.io_snoop_r_o() // snoop input channel;
|
| 378 |
+
// for establishing calibration state
|
| 379 |
+
// on reset
|
| 380 |
+
|
| 381 |
+
,.io_trigger_mode_en_i(1'b0) // enable loop-back trigger mode
|
| 382 |
+
,.io_trigger_mode_alt_en_i(1'b0) // enable loop-back trigger mode: alternate trigger
|
| 383 |
+
|
| 384 |
+
,.core_clk_i(core_1_clk)
|
| 385 |
+
,.core_reset_i(core_1_reset_sync)
|
| 386 |
+
|
| 387 |
+
// core 1 side logical signals
|
| 388 |
+
,.core_data_o(core_1_assembler_data[i])
|
| 389 |
+
,.core_valid_o(core_1_assembler_valid[i])
|
| 390 |
+
,.core_yumi_i(core_1_assembler_yumi[i])
|
| 391 |
+
);
|
| 392 |
+
end
|
| 393 |
+
|
| 394 |
+
// merge them into one bonded channel
|
| 395 |
+
bsg_assembler_in #(.width_p(channel_width_lp)
|
| 396 |
+
,.num_in_p(num_channels_lp)
|
| 397 |
+
,.num_out_p(ring_bytes_lp)
|
| 398 |
+
,.in_channel_count_mask_p(1 << (num_channels_lp-1)) // fixme
|
| 399 |
+
) bai
|
| 400 |
+
(.clk(core_1_clk)
|
| 401 |
+
,.reset(core_1_reset_sync)
|
| 402 |
+
,.valid_i(core_1_assembler_valid)
|
| 403 |
+
,.data_i(core_1_assembler_data)
|
| 404 |
+
,.yumi_o(core_1_assembler_yumi)
|
| 405 |
+
|
| 406 |
+
,.in_top_channel_i(xkr.top_active_channel)
|
| 407 |
+
,.out_top_channel_i(ring_bytes-1'b1)
|
| 408 |
+
|
| 409 |
+
,.valid_o(core_1_valid)
|
| 410 |
+
,.data_o(core_1_data)
|
| 411 |
+
,.yumi_i(core_1_yumi)
|
| 412 |
+
);
|
| 413 |
+
|
| 414 |
+
// consume all data
|
| 415 |
+
assign core_1_yumi = core_1_valid;
|
| 416 |
+
|
| 417 |
+
localparam cycle_counter_width_lp=32;
|
| 418 |
+
|
| 419 |
+
logic [cycle_counter_width_lp-1:0] core_0_ctr;
|
| 420 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp))
|
| 421 |
+
bcc_core0 (core_0_clk, core_0_reset_sync, core_0_ctr);
|
| 422 |
+
|
| 423 |
+
logic [cycle_counter_width_lp-1:0] core_1_ctr;
|
| 424 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp))
|
| 425 |
+
bcc_core1 (core_1_clk, core_1_reset_sync, core_1_ctr);
|
| 426 |
+
|
| 427 |
+
logic [cycle_counter_width_lp-1:0] io_ctr;
|
| 428 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp))
|
| 429 |
+
bcc_io (io_master_clk, io_master_reset_sync, io_ctr);
|
| 430 |
+
|
| 431 |
+
|
| 432 |
+
// non-synthesizable, TEST ONLY
|
| 433 |
+
logic [7:0] core_1_last_n, core_1_last_r = -1;
|
| 434 |
+
logic [5:0] top_bits = 0;
|
| 435 |
+
|
| 436 |
+
assign core_1_last_n = core_1_last_r+8'b1;
|
| 437 |
+
|
| 438 |
+
wire [ring_bytes_lp*channel_width_lp-1:0] core_1_check_data;
|
| 439 |
+
|
| 440 |
+
if (ring_bytes_lp > 1)
|
| 441 |
+
for (i = 0; i < ring_bytes_lp; i++)
|
| 442 |
+
begin
|
| 443 |
+
wire [lg_ring_bytes_lp-1:0] my_id = i[lg_ring_bytes_lp-1:0];
|
| 444 |
+
assign core_1_check_data[channel_width_lp*i+:channel_width_lp]
|
| 445 |
+
= { my_id, core_1_last_n[0+:channel_width_lp-lg_ring_bytes_lp]};
|
| 446 |
+
end
|
| 447 |
+
else
|
| 448 |
+
assign core_1_check_data = core_1_last_n;
|
| 449 |
+
|
| 450 |
+
// *******************************************************
|
| 451 |
+
// *
|
| 452 |
+
// * Logging.
|
| 453 |
+
// *
|
| 454 |
+
// * These statements allow you to see, in time, when values
|
| 455 |
+
// * are transmitted and received.
|
| 456 |
+
// *
|
| 457 |
+
// *
|
| 458 |
+
// * For this test, the number of cycles on the slowest clock should
|
| 459 |
+
// * match the number of words
|
| 460 |
+
// * transmitted plus a small constant.
|
| 461 |
+
// *
|
| 462 |
+
// *
|
| 463 |
+
|
| 464 |
+
logic [31:0] core_1_words_received_r;
|
| 465 |
+
|
| 466 |
+
always @(negedge core_1_clk)
|
| 467 |
+
if (core_1_reset_sync)
|
| 468 |
+
core_1_words_received_r <= 0;
|
| 469 |
+
else
|
| 470 |
+
core_1_words_received_r <= core_1_words_received_r + core_1_valid;
|
| 471 |
+
|
| 472 |
+
integer verbose = 0;
|
| 473 |
+
|
| 474 |
+
always @(negedge core_1_clk)
|
| 475 |
+
if (core_1_valid)
|
| 476 |
+
begin
|
| 477 |
+
if (verbose)
|
| 478 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr
|
| 479 |
+
, " ## core 1 recv %d, %x",top_bits,core_1_data);
|
| 480 |
+
|
| 481 |
+
assert (core_1_check_data == core_1_data)
|
| 482 |
+
else $error("## transmission error %x, %x"
|
| 483 |
+
, core_1_check_data, core_1_data);
|
| 484 |
+
core_1_last_r <= core_1_last_n;
|
| 485 |
+
if (core_1_last_n == 8'hff)
|
| 486 |
+
begin
|
| 487 |
+
if (top_bits == iterations_lp)
|
| 488 |
+
begin
|
| 489 |
+
$display("## DONE CHANNEL_WIDTH=%1d",channel_width_lp
|
| 490 |
+
," RING_BYTES=%2d",ring_bytes_lp
|
| 491 |
+
," NUM_CHAN=%1d",num_channels_lp
|
| 492 |
+
," C0_HP=%1d",core_0_half_period_lp
|
| 493 |
+
," IO_HP=%1d",io_master_half_period_lp
|
| 494 |
+
," C1_PD=%1d",core_1_half_period_lp,
|
| 495 |
+
," (Cycles Per Word) "
|
| 496 |
+
, real'(core_0_ctr) / real'(core_1_words_received_r)," "
|
| 497 |
+
, real'(io_ctr) / real'(core_1_words_received_r), " "
|
| 498 |
+
, real'(core_1_ctr) / real'(core_1_words_received_r));
|
| 499 |
+
$finish("##");
|
| 500 |
+
end
|
| 501 |
+
top_bits = top_bits+1;
|
| 502 |
+
end
|
| 503 |
+
end
|
| 504 |
+
|
| 505 |
+
always @(negedge core_0_clk)
|
| 506 |
+
if (core_0_yumi)
|
| 507 |
+
if (verbose)
|
| 508 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr
|
| 509 |
+
, " ## core 0 sent %lx",core_0_send_data);
|
| 510 |
+
|
| 511 |
+
for (i = 0; i < num_channels_lp; i=i+1)
|
| 512 |
+
begin
|
| 513 |
+
always @(negedge io_master_clk)
|
| 514 |
+
if (verbose)
|
| 515 |
+
begin
|
| 516 |
+
if (io_valid_tline[i])
|
| 517 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr
|
| 518 |
+
, " ## channel %1d", i
|
| 519 |
+
, " (p,n)=(%2d",bsso[i].bsso.bacc1.r_free_credits
|
| 520 |
+
,",%2d",bsso[i].bsso.bacc2.r_free_credits,") "
|
| 521 |
+
," ## io xmit %x",io_data_tline[i]);
|
| 522 |
+
else
|
| 523 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr
|
| 524 |
+
, " ## channel %1d", i, " (p,n)=(%2d"
|
| 525 |
+
,bsso[i].bsso.bacc1.r_free_credits
|
| 526 |
+
,",%2d",bsso[i].bsso.bacc2.r_free_credits,") ");
|
| 527 |
+
end
|
| 528 |
+
end
|
| 529 |
+
endmodule
|
| 530 |
+
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_comm_link/test_bsg_comm_link.sv
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
`include "bsg_defines.sv"
|
| 3 |
+
|
| 4 |
+
`include "test_assembler_defines.sv"
|
| 5 |
+
|
| 6 |
+
module test_bsg_comm_link;
|
| 7 |
+
|
| 8 |
+
`include "test_bsg_clock_params.sv"
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
// number of bits width of a channel
|
| 12 |
+
// must be >= 3; with channel_width = 3
|
| 13 |
+
// calibration will be limited
|
| 14 |
+
|
| 15 |
+
localparam channel_width_lp = `CHANNEL_WIDTH;
|
| 16 |
+
localparam num_channels_lp = `NUM_CHANNELS;
|
| 17 |
+
|
| 18 |
+
// this is the number of bytes that a ring packet is
|
| 19 |
+
localparam ring_bytes_lp = `RING_BYTES;
|
| 20 |
+
|
| 21 |
+
localparam iterations_lp = `ITERATIONS;
|
| 22 |
+
|
| 23 |
+
localparam verbose_lp = 1;
|
| 24 |
+
|
| 25 |
+
// most flexible configuration for assembler
|
| 26 |
+
// any subset of channels (4,3,2,1) may be used
|
| 27 |
+
localparam channel_mask_lp = (1 << num_channels_lp) - 1;
|
| 28 |
+
|
| 29 |
+
genvar i,j;
|
| 30 |
+
|
| 31 |
+
// *************************************************
|
| 32 |
+
// independent clocks and reset
|
| 33 |
+
//
|
| 34 |
+
//
|
| 35 |
+
|
| 36 |
+
logic [1:0] core_clk;
|
| 37 |
+
logic [1:0] io_master_clk;
|
| 38 |
+
|
| 39 |
+
test_bsg_clock_gen #(.cycle_time_p(core_0_period_lp)) c0_clk (.o( core_clk[0]));
|
| 40 |
+
test_bsg_clock_gen #(.cycle_time_p(core_1_period_lp)) c1_clk (.o( core_clk[1]));
|
| 41 |
+
|
| 42 |
+
initial
|
| 43 |
+
$display("%m creating clocks",core_0_period_lp, core_1_period_lp, io_master_0_period_lp, io_master_1_period_lp);
|
| 44 |
+
|
| 45 |
+
test_bsg_clock_gen #(.cycle_time_p(io_master_0_period_lp)) i0_clk (.o(io_master_clk[0]));
|
| 46 |
+
test_bsg_clock_gen #(.cycle_time_p(io_master_1_period_lp)) i1_clk (.o(io_master_clk[1]));
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
logic async_reset;
|
| 50 |
+
|
| 51 |
+
localparam core_reset_cycles_hi_lp = 256;
|
| 52 |
+
localparam core_reset_cycles_lo_lp = 16;
|
| 53 |
+
|
| 54 |
+
test_bsg_reset_gen
|
| 55 |
+
#(.num_clocks_p(4)
|
| 56 |
+
,.reset_cycles_lo_p(core_reset_cycles_lo_lp)
|
| 57 |
+
,.reset_cycles_hi_p(core_reset_cycles_hi_lp)
|
| 58 |
+
) reset_gen
|
| 59 |
+
(.clk_i({ core_clk, io_master_clk })
|
| 60 |
+
,.async_reset_o(async_reset)
|
| 61 |
+
);
|
| 62 |
+
|
| 63 |
+
// Defines for Core Zero and One
|
| 64 |
+
|
| 65 |
+
wire [1:0] core_reset_in;
|
| 66 |
+
wire [1:0] core_calib_reset;
|
| 67 |
+
|
| 68 |
+
wire [1:0] core_valid_out;
|
| 69 |
+
wire [ring_bytes_lp*channel_width_lp-1:0] core_data_out [1:0];
|
| 70 |
+
wire [1:0] core_yumi_out;
|
| 71 |
+
|
| 72 |
+
wire [1:0] core_valid_in;
|
| 73 |
+
wire [ring_bytes_lp*channel_width_lp-1:0] core_data_in [1:0];
|
| 74 |
+
wire [1:0] core_ready_in;
|
| 75 |
+
|
| 76 |
+
//**********************************************************************
|
| 77 |
+
// CORE 0 (sender)
|
| 78 |
+
// ______ _____ ______ _______ _______ _______ ______ _____
|
| 79 |
+
// / _____) ___ \(_____ \(_______) (_______|_______|_____ \ / ___ \
|
| 80 |
+
// | / | | | |_____) )_____ __ _____ _____) ) | | |
|
| 81 |
+
// | | | | | (_____ (| ___) / / | ___) (_____ (| | | |
|
| 82 |
+
// | \____| |___| | | | |_____ / /____| |_____ | | |___| |
|
| 83 |
+
// \______)_____/ |_|_______) (_______)_______) |_|\_____/
|
| 84 |
+
//
|
| 85 |
+
//**********************************************************************
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
// CORE ZERO Send (speaking valid/ready protocol)
|
| 89 |
+
// core_ready signal will be held low by comm_link
|
| 90 |
+
// module until calibration is done.
|
| 91 |
+
|
| 92 |
+
assign core_valid_out[0] = ~core_reset_in[0];
|
| 93 |
+
|
| 94 |
+
test_bsg_data_gen #(.channel_width_p(channel_width_lp)
|
| 95 |
+
,.num_channels_p(ring_bytes_lp)
|
| 96 |
+
) tbdg_send
|
| 97 |
+
(.clk_i(core_clk[0] )
|
| 98 |
+
,.reset_i(core_reset_in[0]) // this is a core, so should be woken up
|
| 99 |
+
// when cores wakeup
|
| 100 |
+
,.yumi_i (core_yumi_out[0])
|
| 101 |
+
,.o (core_data_out[0])
|
| 102 |
+
);
|
| 103 |
+
|
| 104 |
+
// CORE ZERO Receive (speaking valid/yumi protocol)
|
| 105 |
+
//
|
| 106 |
+
|
| 107 |
+
// always eat the data
|
| 108 |
+
assign core_ready_in[0] = 1'b1;
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
//************************************************************
|
| 112 |
+
// CORE 1 (input side)
|
| 113 |
+
// ______ _____ ______ _______ _____ ______ _______
|
| 114 |
+
// / _____) ___ \(_____ \(_______) / ___ \| ___ \(_______)
|
| 115 |
+
// | / | | | |_____) )_____ | | | | | | |_____
|
| 116 |
+
// | | | | | (_____ (| ___) | | | | | | | ___)
|
| 117 |
+
// | \____| |___| | | | |_____ | |___| | | | | |_____
|
| 118 |
+
// \______)_____/ |_|_______) \_____/|_| |_|_______)
|
| 119 |
+
//
|
| 120 |
+
//************************************************************
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
logic [1:0] core_async_reset, core_async_reset_r;
|
| 124 |
+
|
| 125 |
+
bsg_two_fifo #( .width_p(channel_width_lp*ring_bytes_lp)) core_one_fifo
|
| 126 |
+
(.clk_i(core_clk[1])
|
| 127 |
+
|
| 128 |
+
,.reset_i(core_reset_in[1])
|
| 129 |
+
|
| 130 |
+
,.ready_param_o(core_ready_in[1])
|
| 131 |
+
,.v_i (core_valid_in[1])
|
| 132 |
+
,.data_i (core_data_in [1])
|
| 133 |
+
|
| 134 |
+
,.v_o (core_valid_out[1])
|
| 135 |
+
,.data_o(core_data_out [1])
|
| 136 |
+
,.yumi_i(core_yumi_out [1])
|
| 137 |
+
);
|
| 138 |
+
|
| 139 |
+
always @(posedge io_master_clk[1])
|
| 140 |
+
begin
|
| 141 |
+
core_async_reset_r[1] <= core_async_reset[1];
|
| 142 |
+
if (~core_async_reset[1] & core_async_reset_r[1])
|
| 143 |
+
begin
|
| 144 |
+
$display(" _ ");
|
| 145 |
+
$display(" (_) _ ");
|
| 146 |
+
$display(" _____ ___ _ ____ ____ _____ ___ _____ _| |_ ");
|
| 147 |
+
$display("(____ |/___) |/ ___) / ___) ___ |/___) ___ (_ _)");
|
| 148 |
+
$display("/ ___ |___ | ( (___ | | | ____|___ | ____| | |_ ");
|
| 149 |
+
$display("\\_____(___/|_|\\____) |_| |_____|___/|_____) \\__)");
|
| 150 |
+
$display(" ");
|
| 151 |
+
end
|
| 152 |
+
end
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
//************************************************************
|
| 156 |
+
// CORE 1 (input side)
|
| 157 |
+
// ______ _____ ______ _______ ______ __
|
| 158 |
+
// / _____) ___ \(_____ \(_______) / __ | _ / |
|
| 159 |
+
// | / | | | |_____) )_____ | | //| | _| |_ /_/ |
|
| 160 |
+
// | | | | | (_____ (| ___) | |// | | (_ _) | |
|
| 161 |
+
// | \____| |___| | | | |_____ | /__| | |_| | |
|
| 162 |
+
// \______)_____/ |_|_______) \_____/ |_|
|
| 163 |
+
//
|
| 164 |
+
//************************************************************
|
| 165 |
+
|
| 166 |
+
// external signals
|
| 167 |
+
logic [num_channels_lp-1:0] io_clk_tline [1:0], io_valid_tline [1:0];
|
| 168 |
+
logic [channel_width_lp-1:0] io_data_tline [1:0] [num_channels_lp-1:0];
|
| 169 |
+
logic [num_channels_lp-1:0] token_clk_tline [1:0];
|
| 170 |
+
wire [1:0] slave_reset_tline;
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
//************************************************************
|
| 174 |
+
// BREAK PCB WIRES HERE.
|
| 175 |
+
//
|
| 176 |
+
// modify these lines to test stuck-at faults due to assembly
|
| 177 |
+
// issues or just even bad silicon.
|
| 178 |
+
//
|
| 179 |
+
// watch this crazy thing adapt to faults!
|
| 180 |
+
//
|
| 181 |
+
|
| 182 |
+
// A. to FPGA
|
| 183 |
+
|
| 184 |
+
// always @(io_data_tline[1][0]) force io_data_tline[1][0][channel_width_lp-1] = 1; // 0
|
| 185 |
+
// always @(io_data_tline[1][0]) force io_data_tline[1][1][channel_width_lp-1] = 1; // 1
|
| 186 |
+
// always @(io_data_tline[1][0]) force io_data_tline[1][2][channel_width_lp-1] = 1; // 2
|
| 187 |
+
// always @(io_data_tline[1][0]) force io_data_tline[1][3][channel_width_lp-1] = 1; // 3
|
| 188 |
+
|
| 189 |
+
// always @(io_data_tline[1][0]) force io_data_tline[0][0][channel_width_lp-1] = 1;
|
| 190 |
+
// always @(io_data_tline[1][0]) force io_data_tline[0][1][channel_width_lp-1] = 1; // 1
|
| 191 |
+
// always @(io_data_tline[1][0]) force io_data_tline[0][2][channel_width_lp-2] = 1; // 2
|
| 192 |
+
|
| 193 |
+
// B. to ASIC
|
| 194 |
+
|
| 195 |
+
// also: test contamination of calibration code
|
| 196 |
+
// always @(io_data_tline[1][0]) force io_data_tline[0][3][channel_width_lp-1] = 0; // 3
|
| 197 |
+
// always @(io_data_tline[1][0]) force io_valid_tline[0][3] = 1; // 3
|
| 198 |
+
|
| 199 |
+
for (i = 0; i < 2; i++)
|
| 200 |
+
begin : core
|
| 201 |
+
|
| 202 |
+
wire [ring_bytes_lp*channel_width_lp-1:0] core_node_data_lo [0:0];
|
| 203 |
+
wire [ring_bytes_lp*channel_width_lp-1:0] core_node_data_li [0:0];
|
| 204 |
+
|
| 205 |
+
// type translation
|
| 206 |
+
assign core_data_in [i] = core_node_data_lo[0];
|
| 207 |
+
assign core_node_data_li[0] = core_data_out [i];
|
| 208 |
+
|
| 209 |
+
// convention: for signals going between cores
|
| 210 |
+
// the "from core" is used as the index.
|
| 211 |
+
|
| 212 |
+
bsg_comm_link #(.channel_width_p (channel_width_lp)
|
| 213 |
+
, .core_channels_p (ring_bytes_lp)
|
| 214 |
+
, .link_channels_p (num_channels_lp)
|
| 215 |
+
, .nodes_p(1)
|
| 216 |
+
, .channel_mask_p(channel_mask_lp)
|
| 217 |
+
, .master_p(!i)
|
| 218 |
+
, .master_to_slave_speedup_p(master_to_slave_speedup_lp)
|
| 219 |
+
, .snoop_vec_p(1'b1) // ignore packet formats
|
| 220 |
+
, .enabled_at_start_vec_p(1'b1) // enable at start
|
| 221 |
+
, .master_bypass_test_p(5'b1_1_1_1_1)
|
| 222 |
+
) comm_link
|
| 223 |
+
(.core_clk_i (core_clk [i] )
|
| 224 |
+
, .async_reset_i ( (i ? slave_reset_tline[0] : async_reset) )
|
| 225 |
+
, .core_calib_reset_r_o(core_calib_reset [i] )
|
| 226 |
+
|
| 227 |
+
, .io_master_clk_i (io_master_clk [i] )
|
| 228 |
+
|
| 229 |
+
// in from core
|
| 230 |
+
, .core_node_v_i(core_valid_out [i])
|
| 231 |
+
, .core_node_data_i(core_node_data_li)
|
| 232 |
+
, .core_node_yumi_o(core_yumi_out[i])
|
| 233 |
+
|
| 234 |
+
// out to core
|
| 235 |
+
, .core_node_v_o(core_valid_in [i])
|
| 236 |
+
, .core_node_data_o(core_node_data_lo)
|
| 237 |
+
, .core_node_ready_i(core_ready_in [i])
|
| 238 |
+
|
| 239 |
+
// ignore enable and reset.
|
| 240 |
+
, .core_node_en_r_o()
|
| 241 |
+
, .core_node_reset_r_o(core_reset_in[i])
|
| 242 |
+
|
| 243 |
+
// in from i/o
|
| 244 |
+
, .io_valid_tline_i( io_valid_tline [!i])
|
| 245 |
+
, .io_data_tline_i( io_data_tline [!i])
|
| 246 |
+
, .io_clk_tline_i( io_clk_tline [!i]) // clk
|
| 247 |
+
, .io_token_clk_tline_o( token_clk_tline [i] ) // clk
|
| 248 |
+
|
| 249 |
+
// out to i/o
|
| 250 |
+
, .im_valid_tline_o(io_valid_tline[i])
|
| 251 |
+
, .im_data_tline_o( io_data_tline[i])
|
| 252 |
+
, .im_clk_tline_o( io_clk_tline[i]) // clk
|
| 253 |
+
|
| 254 |
+
, .im_slave_reset_tline_r_o ( slave_reset_tline[i])
|
| 255 |
+
, .token_clk_tline_i(token_clk_tline[!i]) // clk
|
| 256 |
+
|
| 257 |
+
// use core_calib_reset instead!
|
| 258 |
+
, .core_async_reset_danger_o (core_async_reset [i] )
|
| 259 |
+
);
|
| 260 |
+
end
|
| 261 |
+
|
| 262 |
+
localparam cycle_counter_width_lp=32;
|
| 263 |
+
|
| 264 |
+
// create some counters to track the four clocks in the system
|
| 265 |
+
logic [cycle_counter_width_lp-1:0] core_ctr[1:0];
|
| 266 |
+
logic [cycle_counter_width_lp-1:0] io_ctr [1:0];
|
| 267 |
+
|
| 268 |
+
// valid only in testbench code: reset violation
|
| 269 |
+
|
| 270 |
+
for (i = 0; i < 2; i=i+1)
|
| 271 |
+
begin
|
| 272 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp))
|
| 273 |
+
my_core_ctr (.clk_i(core_clk[i]), .reset_i(core_calib_reset[i]), .ctr_r_o(core_ctr[i]));
|
| 274 |
+
|
| 275 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp))
|
| 276 |
+
my_io_ctr (.clk_i(io_master_clk[i]), .reset_i(core_calib_reset[i]), .ctr_r_o(io_ctr[i]));
|
| 277 |
+
|
| 278 |
+
test_bsg_comm_link_checker
|
| 279 |
+
#(.channel_width_p(channel_width_lp)
|
| 280 |
+
,.num_channels_p(num_channels_lp)
|
| 281 |
+
,.ring_bytes_p (ring_bytes_lp)
|
| 282 |
+
,.verbose_p (verbose_lp)
|
| 283 |
+
,.iterations_p (iterations_lp)
|
| 284 |
+
,.core_0_period_p(core_0_period_lp)
|
| 285 |
+
,.core_1_period_p(core_1_period_lp)
|
| 286 |
+
,.io_master_0_period_p(io_master_0_period_lp)
|
| 287 |
+
,.io_master_1_period_p(io_master_1_period_lp)
|
| 288 |
+
,.cycle_counter_width_p(cycle_counter_width_lp)
|
| 289 |
+
,.node_num_p(i)
|
| 290 |
+
) checker
|
| 291 |
+
(.clk (core_clk[i])
|
| 292 |
+
,.valid_in(core_valid_in[i])
|
| 293 |
+
,.ready_in(core_ready_in[i])
|
| 294 |
+
,.data_in (core_data_in[i] )
|
| 295 |
+
,.data_out(core_data_out[i])
|
| 296 |
+
,.yumi_out(core_yumi_out[i])
|
| 297 |
+
,.async_reset(core_async_reset[i])
|
| 298 |
+
,.slave_reset_tline(slave_reset_tline[i])
|
| 299 |
+
,.io_valid_tline(io_valid_tline[i])
|
| 300 |
+
,.io_data_tline (io_data_tline[i])
|
| 301 |
+
,.core_ctr(core_ctr)
|
| 302 |
+
,.io_ctr(io_ctr)
|
| 303 |
+
);
|
| 304 |
+
end
|
| 305 |
+
|
| 306 |
+
endmodule
|
| 307 |
+
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_source_sync/Makefile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export LM_LICENSE_FILE = 27000@bbfs-00.calit2.net
|
| 2 |
+
export SYNOPSYS_DIR=/gro/cad/synopsys
|
| 3 |
+
export VCS_RELEASE=vcs/G-2012.09-SP1
|
| 4 |
+
export VCS_HOME = $(SYNOPSYS_DIR)/$(VCS_RELEASE)
|
| 5 |
+
export VCS_BIN = $(VCS_HOME)/bin
|
| 6 |
+
export DVE_BIN = $(VCS_HOME)/bin
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
ASYNC_FILES = bsg_async_credit_counter.sv bsg_async_fifo.sv bsg_async_ptr_gray.sv bsg_gray_to_binary.sv bsg_launch_sync_sync.sv bsg_sync_sync.sv bsg_wait_after_reset.sv
|
| 10 |
+
SOURCE_SYNC_FILES = bsg_source_sync_input.sv bsg_source_sync_output.sv bsg_cycle_counter.sv
|
| 11 |
+
TEST_FILES = test_bsg_source_sync.sv
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
all: $(foreach x,$(ASYNC_FILES),../bsg_async_fifo/$(x)) $(SOURCE_SYNC_FILES) $(TEST_FILES)
|
| 15 |
+
$(VCS_BIN)/vcs -PP -full64 +lint=all +v2k -sverilog -timescale=1ns/10ps $^
|
| 16 |
+
|
| 17 |
+
run:
|
| 18 |
+
./simv
|
| 19 |
+
|
| 20 |
+
dve:
|
| 21 |
+
$(DVE_BIN)/dve -full64 -vpd vcdplus.vpd &
|
| 22 |
+
|
| 23 |
+
%.echo:
|
| 24 |
+
echo $($*)
|
| 25 |
+
|
| 26 |
+
clean:
|
| 27 |
+
rm -rf simv csrc simv.daidir
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/bsg_comm_link/tests/test_bsg_source_sync/test_bsg_source_sync.sv
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// MBT 7-28-2014
|
| 2 |
+
//
|
| 3 |
+
// Test source synchronous link.
|
| 4 |
+
//
|
| 5 |
+
// We model here two cores that have different clocks and are
|
| 6 |
+
// communicating over an I/O channel which has a third clock.
|
| 7 |
+
//
|
| 8 |
+
// Includes model reset logic with synchronizers and delayed
|
| 9 |
+
// communication after reset.
|
| 10 |
+
//
|
| 11 |
+
|
| 12 |
+
`include "bsg_defines.sv"
|
| 13 |
+
|
| 14 |
+
module test_bsg_source_sync_input;
|
| 15 |
+
|
| 16 |
+
initial begin
|
| 17 |
+
$vcdpluson;
|
| 18 |
+
end
|
| 19 |
+
|
| 20 |
+
// three separate clocks: I/O, and the two cores communicating with each other
|
| 21 |
+
localparam core_0_half_period_lp = 5;
|
| 22 |
+
localparam io_master_half_period_lp = 7;
|
| 23 |
+
localparam core_1_half_period_lp = 6;
|
| 24 |
+
|
| 25 |
+
// across all frequency combinations, we need a little over 20 fifo slots
|
| 26 |
+
// so we round up to 32.
|
| 27 |
+
|
| 28 |
+
localparam lg_input_fifo_depth_lp = 5;
|
| 29 |
+
|
| 30 |
+
// for DDR at 500 mbps, we make token go at / 8 = 66 mbps
|
| 31 |
+
// this will keep the token clock nice and slow
|
| 32 |
+
|
| 33 |
+
localparam lg_credit_to_token_decimation_lp=3;
|
| 34 |
+
|
| 35 |
+
// number of bits width of a channel
|
| 36 |
+
localparam channel_width_lp=8;
|
| 37 |
+
|
| 38 |
+
// *************************************************
|
| 39 |
+
// independent clocks
|
| 40 |
+
//
|
| 41 |
+
//
|
| 42 |
+
|
| 43 |
+
logic core_0_clk, core_1_clk, io_master_clk;
|
| 44 |
+
|
| 45 |
+
initial core_0_clk = 0;
|
| 46 |
+
always #(core_0_half_period_lp) core_0_clk = ~core_0_clk;
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
initial io_master_clk = 0;
|
| 50 |
+
always #(io_master_half_period_lp) io_master_clk = ~io_master_clk;
|
| 51 |
+
|
| 52 |
+
initial core_1_clk = 0;
|
| 53 |
+
always #(core_1_half_period_lp) core_1_clk = ~core_1_clk;
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
// *************************************************
|
| 57 |
+
// master resets
|
| 58 |
+
//
|
| 59 |
+
|
| 60 |
+
logic core_0_reset, core_1_reset;
|
| 61 |
+
|
| 62 |
+
localparam core_reset_cycles_hi_lp = 256;
|
| 63 |
+
localparam core_reset_cycles_lo_lp = 16;
|
| 64 |
+
|
| 65 |
+
// we model this as if the FPGA is driving this with an unknown clock.
|
| 66 |
+
initial
|
| 67 |
+
begin
|
| 68 |
+
core_0_reset = 0;
|
| 69 |
+
core_1_reset = 0;
|
| 70 |
+
// simple hack to wait based on maximum of clock periods
|
| 71 |
+
repeat (core_reset_cycles_lo_lp)
|
| 72 |
+
begin
|
| 73 |
+
@(negedge core_0_clk);
|
| 74 |
+
@(negedge core_1_clk);
|
| 75 |
+
@(negedge io_master_clk);
|
| 76 |
+
end
|
| 77 |
+
|
| 78 |
+
core_0_reset = 1;
|
| 79 |
+
core_1_reset = 1;
|
| 80 |
+
// simple hack to wait based on maximum of clock periods
|
| 81 |
+
repeat (core_reset_cycles_hi_lp)
|
| 82 |
+
begin
|
| 83 |
+
@(negedge core_0_clk);
|
| 84 |
+
@(negedge core_1_clk);
|
| 85 |
+
@(negedge io_master_clk);
|
| 86 |
+
end
|
| 87 |
+
|
| 88 |
+
core_0_reset = 0;
|
| 89 |
+
core_1_reset = 0;
|
| 90 |
+
|
| 91 |
+
$display("__________ ___________ _______________________________");
|
| 92 |
+
$display("\\______ \\\\_ _____/ / _____/\\_ _____/\\__ ___/");
|
| 93 |
+
$display(" | _/ | __)_ \\_____ \\ | __)_ | | ");
|
| 94 |
+
$display(" | | \\ | \\ / \\ | \\ | | ");
|
| 95 |
+
$display(" |____|_ //_______ //_______ //_______ / |____| ");
|
| 96 |
+
$display(" \\/ \\/ \\/ \\/ ");
|
| 97 |
+
end
|
| 98 |
+
|
| 99 |
+
// *****************************************
|
| 100 |
+
// * CORE 0 (sender)
|
| 101 |
+
// *
|
| 102 |
+
// *
|
| 103 |
+
// *
|
| 104 |
+
|
| 105 |
+
wire core_0_reset_sync, io_master_reset_sync, token_reset_sync;
|
| 106 |
+
|
| 107 |
+
// reset synchronizer: core clock reset
|
| 108 |
+
bsg_sync_sync #(.width_p(1)) bss_core_reset
|
| 109 |
+
(.oclk_i(core_0_clk)
|
| 110 |
+
,.iclk_data_i(core_0_reset)
|
| 111 |
+
,.oclk_data_o(core_0_reset_sync)
|
| 112 |
+
);
|
| 113 |
+
|
| 114 |
+
// reset synchronizer: master clock reset
|
| 115 |
+
bsg_sync_sync #(.width_p(1)) bss_io_master_reset
|
| 116 |
+
(.oclk_i(io_master_clk)
|
| 117 |
+
,.iclk_data_i(core_0_reset)
|
| 118 |
+
,.oclk_data_o(io_master_reset_sync)
|
| 119 |
+
);
|
| 120 |
+
|
| 121 |
+
// reset synchronizer: token reset
|
| 122 |
+
bsg_sync_sync #(.width_p(1)) bss_token_reset
|
| 123 |
+
(.oclk_i(io_master_clk)
|
| 124 |
+
,.iclk_data_i(core_0_reset)
|
| 125 |
+
,.oclk_data_o(token_reset_sync)
|
| 126 |
+
);
|
| 127 |
+
|
| 128 |
+
logic [channel_width_lp-1:0] core_0_data_r;
|
| 129 |
+
logic core_0_valid_r;
|
| 130 |
+
|
| 131 |
+
// wait a certain number of cycles after reset before restarting
|
| 132 |
+
localparam lg_wait_cycles_activate_lp = 4;
|
| 133 |
+
wire core_reset_ready;
|
| 134 |
+
|
| 135 |
+
bsg_wait_after_reset #(.lg_wait_cycles_p(lg_wait_cycles_activate_lp)) bwar
|
| 136 |
+
(.reset_i(core_0_reset_sync)
|
| 137 |
+
,.clk_i(core_0_clk)
|
| 138 |
+
,.ready_r_o(core_reset_ready)
|
| 139 |
+
);
|
| 140 |
+
|
| 141 |
+
// only start sending after a certain number of cycles
|
| 142 |
+
assign core_0_valid_r = core_reset_ready;
|
| 143 |
+
wire core_0_yumi;
|
| 144 |
+
|
| 145 |
+
// transmit sequence of data values
|
| 146 |
+
always @(posedge core_0_clk)
|
| 147 |
+
if (core_0_reset_sync)
|
| 148 |
+
core_0_data_r <= 0;
|
| 149 |
+
else
|
| 150 |
+
if (core_0_yumi)
|
| 151 |
+
core_0_data_r <= core_0_data_r + 1;
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
// ***********************************************
|
| 155 |
+
// TOKEN RESET LOGIC
|
| 156 |
+
//
|
| 157 |
+
// reset logic for clearing output channel's
|
| 158 |
+
// token-clocked logic.
|
| 159 |
+
//
|
| 160 |
+
|
| 161 |
+
logic io_override_en;
|
| 162 |
+
logic [channel_width_lp+1-1:0] io_override_valid_data;
|
| 163 |
+
logic io_master_reset_sync_r;
|
| 164 |
+
logic [10:0] io_reset_counter_r;
|
| 165 |
+
|
| 166 |
+
always @(posedge io_master_clk)
|
| 167 |
+
begin
|
| 168 |
+
io_master_reset_sync_r <= io_master_reset_sync;
|
| 169 |
+
|
| 170 |
+
// on positive edge of reset, we initialize the counter
|
| 171 |
+
// the counter continuously counts during reset
|
| 172 |
+
// and is zero'd when not in reset
|
| 173 |
+
if (io_master_reset_sync)
|
| 174 |
+
begin
|
| 175 |
+
if (~io_master_reset_sync_r)
|
| 176 |
+
io_reset_counter_r <= 1;
|
| 177 |
+
else
|
| 178 |
+
io_reset_counter_r <= io_reset_counter_r + 1;
|
| 179 |
+
end
|
| 180 |
+
else
|
| 181 |
+
io_reset_counter_r <= 0;
|
| 182 |
+
end
|
| 183 |
+
|
| 184 |
+
// this asserts the override data while the reset counter
|
| 185 |
+
// is in its active portion
|
| 186 |
+
|
| 187 |
+
always_comb
|
| 188 |
+
begin
|
| 189 |
+
io_override_en = io_master_reset_sync;
|
| 190 |
+
io_override_valid_data = { 0'b0, 0'h00 };
|
| 191 |
+
|
| 192 |
+
// for 2^6 cycles, assert the "token reset code"
|
| 193 |
+
if (io_reset_counter_r[10:6] == 5'b00001)
|
| 194 |
+
io_override_valid_data = { 1'b1, 8'h80 };
|
| 195 |
+
end
|
| 196 |
+
|
| 197 |
+
// ***********************************************
|
| 198 |
+
// declare signals going out over transmission lines
|
| 199 |
+
// between input and output channel
|
| 200 |
+
//
|
| 201 |
+
|
| 202 |
+
wire io_clk_tline, io_valid_tline;
|
| 203 |
+
wire [channel_width_lp-1:0] io_data_tline;
|
| 204 |
+
wire token_clk_tline;
|
| 205 |
+
|
| 206 |
+
bsg_source_sync_output #(.lg_start_credits_p(lg_input_fifo_depth_lp)
|
| 207 |
+
,.lg_credit_to_token_decimation_p(lg_credit_to_token_decimation_lp)
|
| 208 |
+
,.channel_width_p(channel_width_lp)
|
| 209 |
+
) bsso_o1
|
| 210 |
+
(.core_clk_i(core_0_clk)
|
| 211 |
+
,.core_reset_i(core_0_reset_sync)
|
| 212 |
+
|
| 213 |
+
// core 0 side logical signals
|
| 214 |
+
,.core_data_i(core_0_data_r)
|
| 215 |
+
,.core_valid_i(core_0_valid_r)
|
| 216 |
+
,.core_yumi_o(core_0_yumi)
|
| 217 |
+
|
| 218 |
+
,.io_master_clk_i(io_master_clk)
|
| 219 |
+
,.io_reset_i(io_master_reset_sync)
|
| 220 |
+
|
| 221 |
+
,.io_override_en_i(io_override_en)
|
| 222 |
+
,.io_override_valid_data_i(io_override_valid_data)
|
| 223 |
+
|
| 224 |
+
,.io_clk_r_o(io_clk_tline) // output to other node
|
| 225 |
+
,.io_data_r_o(io_data_tline) // output to other node
|
| 226 |
+
,.io_valid_r_o(io_valid_tline) // output to other node
|
| 227 |
+
|
| 228 |
+
,.token_clk_i(token_clk_tline) // input from other node
|
| 229 |
+
,.token_reset_i(token_reset_sync) // from core 0
|
| 230 |
+
);
|
| 231 |
+
|
| 232 |
+
// *****************************************
|
| 233 |
+
// * CORE 1 (input side)
|
| 234 |
+
// *
|
| 235 |
+
// *
|
| 236 |
+
// *
|
| 237 |
+
|
| 238 |
+
localparam lg_io_delay_reset_lp = 6;
|
| 239 |
+
|
| 240 |
+
wire io_1_reset_sync, core_1_reset_sync;
|
| 241 |
+
|
| 242 |
+
bsg_sync_sync #(.width_p(1)) bss_core_1_reset
|
| 243 |
+
(.oclk_i(core_1_clk)
|
| 244 |
+
,.iclk_data_i(core_1_reset)
|
| 245 |
+
,.oclk_data_o(core_1_reset_sync)
|
| 246 |
+
);
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
bsg_sync_sync #(.width_p(1)) bss_io_1_reset
|
| 250 |
+
(.oclk_i(io_clk_tline)
|
| 251 |
+
,.iclk_data_i(core_1_reset)
|
| 252 |
+
,.oclk_data_o(io_1_reset_sync)
|
| 253 |
+
);
|
| 254 |
+
|
| 255 |
+
wire core_1_yumi;
|
| 256 |
+
wire core_1_valid;
|
| 257 |
+
wire [channel_width_lp-1:0] core_1_data;
|
| 258 |
+
|
| 259 |
+
bsg_source_sync_input #(.lg_fifo_depth_p(lg_input_fifo_depth_lp)
|
| 260 |
+
,.lg_credit_to_token_decimation_p(lg_credit_to_token_decimation_lp)
|
| 261 |
+
,.channel_width_p(channel_width_lp)
|
| 262 |
+
) bssi_i1
|
| 263 |
+
(.io_clk_i(io_clk_tline) // input from other node; starts on reset
|
| 264 |
+
,.io_reset_i(io_1_reset_sync)
|
| 265 |
+
,.io_data_i(io_data_tline) // input from other node
|
| 266 |
+
,.io_valid_i(io_valid_tline) // input from other node
|
| 267 |
+
|
| 268 |
+
,.io_edge_i(2'b11) // latch on both edges
|
| 269 |
+
|
| 270 |
+
,.io_token_r_o(token_clk_tline) // output to other node
|
| 271 |
+
|
| 272 |
+
,.io_snoop_r_o() // snoop input channel;
|
| 273 |
+
// for establishing calibration state
|
| 274 |
+
// on reset
|
| 275 |
+
|
| 276 |
+
,.io_trigger_mode_en_i(1'b0) // enable loop-back trigger mode
|
| 277 |
+
,.io_trigger_mode_alt_en_i(1'b0) // enable loop-back trigger mode: alternate trigger
|
| 278 |
+
|
| 279 |
+
,.core_clk_i(core_1_clk)
|
| 280 |
+
,.core_reset_i(core_1_reset_sync)
|
| 281 |
+
|
| 282 |
+
// core 1 side logical signals
|
| 283 |
+
,.core_data_o(core_1_data)
|
| 284 |
+
,.core_valid_o(core_1_valid)
|
| 285 |
+
,.core_yumi_i(core_1_yumi)
|
| 286 |
+
);
|
| 287 |
+
|
| 288 |
+
// consume all data
|
| 289 |
+
assign core_1_yumi = core_1_valid;
|
| 290 |
+
|
| 291 |
+
localparam cycle_counter_width_lp=32;
|
| 292 |
+
|
| 293 |
+
logic [cycle_counter_width_lp-1:0] core_0_ctr;
|
| 294 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp)) bcc_core0 (core_0_clk, core_0_reset_sync, core_0_ctr);
|
| 295 |
+
|
| 296 |
+
logic [cycle_counter_width_lp-1:0] core_1_ctr;
|
| 297 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp)) bcc_core1 (core_1_clk, core_1_reset_sync, core_1_ctr);
|
| 298 |
+
|
| 299 |
+
logic [cycle_counter_width_lp-1:0] io_ctr;
|
| 300 |
+
bsg_cycle_counter #(.width_p(cycle_counter_width_lp)) bcc_io (io_master_clk, io_master_reset_sync, io_ctr);
|
| 301 |
+
|
| 302 |
+
|
| 303 |
+
// non-synthesizable, TEST ONLY
|
| 304 |
+
logic [7:0] core_1_last_n, core_1_last_r = -1;
|
| 305 |
+
logic [5:0] top_bits = 0;
|
| 306 |
+
|
| 307 |
+
assign core_1_last_n = core_1_last_r+8'b1;
|
| 308 |
+
|
| 309 |
+
// *******************************************************
|
| 310 |
+
// *
|
| 311 |
+
// * Logging.
|
| 312 |
+
// *
|
| 313 |
+
// * These statements allow you to see, in time, when values are transmitted and received.
|
| 314 |
+
// *
|
| 315 |
+
// *
|
| 316 |
+
// * For this test, the number of cycles on the slowest clock should match the number of words
|
| 317 |
+
// * transmitted plus a small constant.
|
| 318 |
+
// *
|
| 319 |
+
// *
|
| 320 |
+
|
| 321 |
+
always @(negedge core_1_clk)
|
| 322 |
+
if (core_1_valid)
|
| 323 |
+
begin
|
| 324 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr, " ## core 1 recv %d, %d",top_bits*256,core_1_data);
|
| 325 |
+
assert (core_1_last_n == core_1_data) else $error("##transmission error", core_1_last_r, core_1_data);
|
| 326 |
+
core_1_last_r <= core_1_last_n;
|
| 327 |
+
if (core_1_data == 8'hff)
|
| 328 |
+
begin
|
| 329 |
+
if (top_bits == 6'b000_111)
|
| 330 |
+
$finish("## DONE");
|
| 331 |
+
top_bits = top_bits+1;
|
| 332 |
+
end
|
| 333 |
+
end
|
| 334 |
+
|
| 335 |
+
always @(negedge core_0_clk)
|
| 336 |
+
if (core_0_yumi)
|
| 337 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr, " ## core 0 sent %d",core_0_data_r);
|
| 338 |
+
|
| 339 |
+
always @(negedge io_master_clk)
|
| 340 |
+
if (io_valid_tline)
|
| 341 |
+
$display("## ", core_0_ctr, io_ctr, core_1_ctr, " ## io xmit %d",io_data_tline);
|
| 342 |
+
endmodule
|
| 343 |
+
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/fakeram/bsg_mem_1rw_sync_macros.svh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
`ifndef BSG_MEM_1RW_SYNC_MACROS
|
| 3 |
+
`define BSG_MEM_1RW_SYNC_MACROS
|
| 4 |
+
|
| 5 |
+
`define bsg_mem_1rw_sync_1rf_macro(words,bits,tag) \
|
| 6 |
+
`bsg_mem_1rw_sync_1sram_macro(words,bits)
|
| 7 |
+
`define bsg_mem_1rw_sync_1hdsram_macro(words,bits,tag) \
|
| 8 |
+
`bsg_mem_1rw_sync_1sram_macro(words,bits)
|
| 9 |
+
|
| 10 |
+
`define bsg_mem_1rw_sync_1sram_macro(words,bits,tag) \
|
| 11 |
+
if (els_p == words && width_p == bits) \
|
| 12 |
+
begin: macro \
|
| 13 |
+
fakeram_d``words``_w``bits`` mem \
|
| 14 |
+
(.clk(clk_i) \
|
| 15 |
+
,.ce_in(v_i) \
|
| 16 |
+
,.we_in(w_i) \
|
| 17 |
+
,.wd_in(data_i) \
|
| 18 |
+
,.w_mask_in('1) \
|
| 19 |
+
,.addr_in(addr_i) \
|
| 20 |
+
,.rd_out(data_o) \
|
| 21 |
+
); \
|
| 22 |
+
end
|
| 23 |
+
|
| 24 |
+
`endif
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/fakeram/bsg_mem_1rw_sync_mask_write_bit_macros.svh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
`ifndef BSG_MEM_1RW_SYNC_MASK_WRITE_BIT_MACROS
|
| 3 |
+
`define BSG_MEM_1RW_SYNC_MASK_WRITE_BIT_MACROS
|
| 4 |
+
|
| 5 |
+
`define bsg_mem_1rw_sync_mask_write_bit_1rf_macro(words,bits,tag) \
|
| 6 |
+
`bsg_mem_1rw_sync_mask_write_bit_1sram_macro(words,bits)
|
| 7 |
+
`define bsg_mem_1rw_sync_mask_write_bit_1hdsram_macro(words,bits,tag) \
|
| 8 |
+
`bsg_mem_1rw_sync_mask_write_bit_1sram_macro(words,bits)
|
| 9 |
+
|
| 10 |
+
`define bsg_mem_1rw_sync_mask_write_bit_1sram_macro(words,bits,tag) \
|
| 11 |
+
if (els_p == words && width_p == bits) \
|
| 12 |
+
begin: macro \
|
| 13 |
+
fakeram_d``words``_w``bits`` mem \
|
| 14 |
+
(.clk(clk_i) \
|
| 15 |
+
,.ce_in(v_i) \
|
| 16 |
+
,.we_in(w_i) \
|
| 17 |
+
,.wd_in(data_i) \
|
| 18 |
+
,.w_mask_in(w_mask_i) \
|
| 19 |
+
,.addr_in(addr_i) \
|
| 20 |
+
,.rd_out(data_o) \
|
| 21 |
+
); \
|
| 22 |
+
end
|
| 23 |
+
|
| 24 |
+
`endif
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/fakeram/bsg_mem_1rw_sync_mask_write_byte_macros.svh
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
`ifndef BSG_MEM_1RW_SYNC_MASK_WRITE_BYTE_MACROS
|
| 3 |
+
`define BSG_MEM_1RW_SYNC_MASK_WRITE_BYTE_MACROS
|
| 4 |
+
|
| 5 |
+
`define bsg_mem_1rw_sync_mask_write_byte_1rf_macro(words,bits,tag) \
|
| 6 |
+
`bsg_mem_1rw_sync_mask_write_byte_1sram_macro(words,bits)
|
| 7 |
+
`define bsg_mem_1rw_sync_mask_write_byte_1hdsram_macro(words,bits,tag) \
|
| 8 |
+
`bsg_mem_1rw_sync_mask_write_byte_1sram_macro(words,bits)
|
| 9 |
+
|
| 10 |
+
`define bsg_mem_1rw_sync_mask_write_byte_1sram_macro(words,bits,tag) \
|
| 11 |
+
if (els_p == words && data_width_p == bits) \
|
| 12 |
+
begin: macro \
|
| 13 |
+
logic [data_width_p-1:0] w_mask_lo; \
|
| 14 |
+
bsg_expand_bitmask \
|
| 15 |
+
#(.in_width_p(write_mask_width_lp), .expand_p(8)) \
|
| 16 |
+
wmask_expand \
|
| 17 |
+
(.i(write_mask_i) \
|
| 18 |
+
,.o(w_mask_lo) \
|
| 19 |
+
); \
|
| 20 |
+
\
|
| 21 |
+
fakeram_d``words``_w``bits`` mem \
|
| 22 |
+
(.clk(clk_i) \
|
| 23 |
+
,.ce_in(v_i) \
|
| 24 |
+
,.we_in(w_i) \
|
| 25 |
+
,.wd_in(data_i) \
|
| 26 |
+
,.w_mask_in(w_mask_lo) \
|
| 27 |
+
,.addr_in(addr_i) \
|
| 28 |
+
,.rd_out(data_o) \
|
| 29 |
+
); \
|
| 30 |
+
end
|
| 31 |
+
|
| 32 |
+
`endif
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/gf_14/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GF14 Hard Directory
|
| 2 |
+
|
| 3 |
+
This directory contains hardened (process specific) variants of basejump_stl
|
| 4 |
+
RTL modules. These modules should be swapped with the RTL modules of the same
|
| 5 |
+
name during the chip implementation flow.
|
| 6 |
+
|
| 7 |
+
## Special Attributes
|
| 8 |
+
|
| 9 |
+
Cell instances with the `*BSG_DONT_TOUCH*` in the name should get a dont_touch
|
| 10 |
+
attribute applied to these instances in the backend flow.
|
| 11 |
+
|
| 12 |
+
All instances of library cell `*SYNC*DFF*` should automatically get a dont_touch
|
| 13 |
+
attribute (regardless of the instance name).
|
| 14 |
+
|
| 15 |
+
Cell instances with the `*BSG_NO_CLOCK_GATE*` in the name should get an attribute
|
| 16 |
+
to prevent clock gating on this module/cell.
|
| 17 |
+
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_async/bsg_launch_sync_sync.sv
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// MBT 7/24/2014
|
| 2 |
+
//
|
| 3 |
+
// This is a launch/synchronization complex.
|
| 4 |
+
// The launch flop prevents combinational glitching.
|
| 5 |
+
// The two sync flops reduce probability of metastability.
|
| 6 |
+
// See MBT's note on async design and CDC.
|
| 7 |
+
//
|
| 8 |
+
// The three flops should be don't touched in synopsys
|
| 9 |
+
// and abutted in physical design to reduce chances of metastability.
|
| 10 |
+
//
|
| 11 |
+
// Use of reset is optional; it can be used to hold a known value during reset
|
| 12 |
+
// if for instance, the value is coming off chip.
|
| 13 |
+
//
|
| 14 |
+
|
| 15 |
+
// the code is structured this way because synopsys's
|
| 16 |
+
// support for hierarchical placement groups appears
|
| 17 |
+
// not to work for parameterized modules.
|
| 18 |
+
// so we must have a non-parameterized module
|
| 19 |
+
// in order to abut the three registers, which
|
| 20 |
+
// have two different clocks.
|
| 21 |
+
//
|
| 22 |
+
|
| 23 |
+
`define bsg_launch_sync_sync_unit_hard(EDGE,bits) \
|
| 24 |
+
\
|
| 25 |
+
module bsg_launch_sync_sync_``EDGE``_``bits``_unit \
|
| 26 |
+
(input iclk_i \
|
| 27 |
+
,input iclk_reset_i \
|
| 28 |
+
,input oclk_i \
|
| 29 |
+
,input [bits-1:0] iclk_data_i \
|
| 30 |
+
,output [bits-1:0] iclk_data_o \
|
| 31 |
+
,output [bits-1:0] oclk_data_o \
|
| 32 |
+
); \
|
| 33 |
+
\
|
| 34 |
+
genvar i; \
|
| 35 |
+
\
|
| 36 |
+
logic [bits-1:0] bsg_SYNC_LNCH_r; \
|
| 37 |
+
logic [bits-1:0] bsg_SYNC_2_r; \
|
| 38 |
+
\
|
| 39 |
+
assign iclk_data_o = bsg_SYNC_LNCH_r; \
|
| 40 |
+
assign oclk_data_o = bsg_SYNC_2_r; \
|
| 41 |
+
\
|
| 42 |
+
always_ff @(EDGE iclk_i) \
|
| 43 |
+
begin \
|
| 44 |
+
if (iclk_reset_i) \
|
| 45 |
+
bsg_SYNC_LNCH_r <= {bits{1'b0}}; \
|
| 46 |
+
else \
|
| 47 |
+
bsg_SYNC_LNCH_r <= iclk_data_i; \
|
| 48 |
+
end \
|
| 49 |
+
\
|
| 50 |
+
for (i = 0; i < bits; i = i + 1) \
|
| 51 |
+
begin : blss_unit \
|
| 52 |
+
SDFFYQ2D_X2N_A7P5PP96PTS_C16 hard_sync_int \
|
| 53 |
+
(.D (bsg_SYNC_LNCH_r[i]) \
|
| 54 |
+
,.CK (oclk_i) \
|
| 55 |
+
,.SI (1'b0) \
|
| 56 |
+
,.SE (1'b0) \
|
| 57 |
+
,.Q (bsg_SYNC_2_r[i]) \
|
| 58 |
+
); \
|
| 59 |
+
end \
|
| 60 |
+
\
|
| 61 |
+
endmodule
|
| 62 |
+
|
| 63 |
+
`BSG_ABSTRACT_MODULE(bsg_launch_sync_sync)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
// bsg_launch_sync_sync_posedge_1_unit
|
| 67 |
+
`bsg_launch_sync_sync_unit_hard(posedge,1)
|
| 68 |
+
`bsg_launch_sync_sync_unit_hard(posedge,2)
|
| 69 |
+
`bsg_launch_sync_sync_unit_hard(posedge,3)
|
| 70 |
+
`bsg_launch_sync_sync_unit_hard(posedge,4)
|
| 71 |
+
`bsg_launch_sync_sync_unit_hard(posedge,5)
|
| 72 |
+
`bsg_launch_sync_sync_unit_hard(posedge,6)
|
| 73 |
+
`bsg_launch_sync_sync_unit_hard(posedge,7)
|
| 74 |
+
`bsg_launch_sync_sync_unit_hard(posedge,8)
|
| 75 |
+
|
| 76 |
+
// bsg_launch_sync_sync_negedge_1_unit
|
| 77 |
+
`bsg_launch_sync_sync_unit_hard(negedge,1)
|
| 78 |
+
`bsg_launch_sync_sync_unit_hard(negedge,2)
|
| 79 |
+
`bsg_launch_sync_sync_unit_hard(negedge,3)
|
| 80 |
+
`bsg_launch_sync_sync_unit_hard(negedge,4)
|
| 81 |
+
`bsg_launch_sync_sync_unit_hard(negedge,5)
|
| 82 |
+
`bsg_launch_sync_sync_unit_hard(negedge,6)
|
| 83 |
+
`bsg_launch_sync_sync_unit_hard(negedge,7)
|
| 84 |
+
`bsg_launch_sync_sync_unit_hard(negedge,8)
|
| 85 |
+
|
| 86 |
+
// warning: if you make this != 8, you need
|
| 87 |
+
// to modify other parts of this code
|
| 88 |
+
|
| 89 |
+
`define blss_max_block 8
|
| 90 |
+
|
| 91 |
+
// handle trailer bits
|
| 92 |
+
`define blss_if_clause(EDGE,num) if ((width_p % `blss_max_block) == num) begin: z \
|
| 93 |
+
bsg_launch_sync_sync_``EDGE``_``num``_unit blss \
|
| 94 |
+
(.iclk_i \
|
| 95 |
+
,.iclk_reset_i \
|
| 96 |
+
,.oclk_i \
|
| 97 |
+
,.iclk_data_i(iclk_data_i[width_p-1-:num]) \
|
| 98 |
+
,.iclk_data_o(iclk_data_o[width_p-1-:num]) \
|
| 99 |
+
,.oclk_data_o(oclk_data_o[width_p-1-:num]) \
|
| 100 |
+
); end
|
| 101 |
+
|
| 102 |
+
module bsg_launch_sync_sync #(parameter `BSG_INV_PARAM(width_p)
|
| 103 |
+
, parameter use_negedge_for_launch_p = 0)
|
| 104 |
+
(input iclk_i
|
| 105 |
+
, input iclk_reset_i
|
| 106 |
+
, input oclk_i
|
| 107 |
+
, input [width_p-1:0] iclk_data_i
|
| 108 |
+
, output [width_p-1:0] iclk_data_o // after launch flop
|
| 109 |
+
, output [width_p-1:0] oclk_data_o // after sync flops
|
| 110 |
+
);
|
| 111 |
+
|
| 112 |
+
genvar i;
|
| 113 |
+
|
| 114 |
+
`ifndef BSG_HIDE_FROM_SYNTHESIS
|
| 115 |
+
initial assert (iclk_reset_i !== 'z)
|
| 116 |
+
else
|
| 117 |
+
begin
|
| 118 |
+
$error("%m iclk_reset should be connected");
|
| 119 |
+
$finish();
|
| 120 |
+
end
|
| 121 |
+
`endif
|
| 122 |
+
|
| 123 |
+
if (use_negedge_for_launch_p)
|
| 124 |
+
begin: n
|
| 125 |
+
for (i = 0; i < (width_p/`blss_max_block); i = i + 1)
|
| 126 |
+
begin : maxb
|
| 127 |
+
bsg_launch_sync_sync_negedge_8_unit blss
|
| 128 |
+
(.iclk_i
|
| 129 |
+
,.iclk_reset_i
|
| 130 |
+
,.oclk_i
|
| 131 |
+
,.iclk_data_i(iclk_data_i[i*`blss_max_block+:`blss_max_block])
|
| 132 |
+
,.iclk_data_o(iclk_data_o[i*`blss_max_block+:`blss_max_block])
|
| 133 |
+
,.oclk_data_o(oclk_data_o[i*`blss_max_block+:`blss_max_block])
|
| 134 |
+
);
|
| 135 |
+
end
|
| 136 |
+
|
| 137 |
+
`blss_if_clause(negedge,1) else
|
| 138 |
+
`blss_if_clause(negedge,2) else
|
| 139 |
+
`blss_if_clause(negedge,3) else
|
| 140 |
+
`blss_if_clause(negedge,4) else
|
| 141 |
+
`blss_if_clause(negedge,5) else
|
| 142 |
+
`blss_if_clause(negedge,6) else
|
| 143 |
+
`blss_if_clause(negedge,7)
|
| 144 |
+
end
|
| 145 |
+
else
|
| 146 |
+
begin: p
|
| 147 |
+
for (i = 0; i < (width_p/`blss_max_block); i = i + 1)
|
| 148 |
+
begin : maxb
|
| 149 |
+
bsg_launch_sync_sync_posedge_8_unit blss
|
| 150 |
+
(.iclk_i
|
| 151 |
+
,.iclk_reset_i
|
| 152 |
+
,.oclk_i
|
| 153 |
+
,.iclk_data_i(iclk_data_i[i*`blss_max_block+:`blss_max_block])
|
| 154 |
+
,.iclk_data_o(iclk_data_o[i*`blss_max_block+:`blss_max_block])
|
| 155 |
+
,.oclk_data_o(oclk_data_o[i*`blss_max_block+:`blss_max_block])
|
| 156 |
+
);
|
| 157 |
+
end
|
| 158 |
+
|
| 159 |
+
`blss_if_clause(posedge,1) else
|
| 160 |
+
`blss_if_clause(posedge,2) else
|
| 161 |
+
`blss_if_clause(posedge,3) else
|
| 162 |
+
`blss_if_clause(posedge,4) else
|
| 163 |
+
`blss_if_clause(posedge,5) else
|
| 164 |
+
`blss_if_clause(posedge,6) else
|
| 165 |
+
`blss_if_clause(posedge,7)
|
| 166 |
+
end
|
| 167 |
+
|
| 168 |
+
endmodule
|
| 169 |
+
|
| 170 |
+
`BSG_ABSTRACT_MODULE(bsg_launch_sync_sync)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_async/bsg_sync_sync.sv
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// MBT 7/24/2014
|
| 2 |
+
//
|
| 3 |
+
// bsg_sync_sync
|
| 4 |
+
//
|
| 5 |
+
// This is just two synchronization flops.
|
| 6 |
+
//
|
| 7 |
+
// We use the rp placement flop from synopsys.
|
| 8 |
+
// Fixme: move this into asic-specific components.
|
| 9 |
+
//
|
| 10 |
+
|
| 11 |
+
`define bsg_sync_sync_unit_hard(width_p) \
|
| 12 |
+
\
|
| 13 |
+
module bsg_sync_sync_``width_p``_unit \
|
| 14 |
+
(input oclk_i \
|
| 15 |
+
,input [width_p-1:0] iclk_data_i \
|
| 16 |
+
,output [width_p-1:0] oclk_data_o // after sync flops \
|
| 17 |
+
); \
|
| 18 |
+
\
|
| 19 |
+
genvar i; \
|
| 20 |
+
\
|
| 21 |
+
logic [width_p-1:0] bsg_SYNC_2_r; \
|
| 22 |
+
\
|
| 23 |
+
assign oclk_data_o = bsg_SYNC_2_r; \
|
| 24 |
+
\
|
| 25 |
+
for (i = 0; i < width_p; i = i + 1) \
|
| 26 |
+
begin : bss_unit \
|
| 27 |
+
SDFFYQ2D_X2N_A7P5PP96PTS_C16 hard_sync_int \
|
| 28 |
+
(.D (iclk_data_i[i]) \
|
| 29 |
+
,.CK (oclk_i) \
|
| 30 |
+
,.SI (1'b0) \
|
| 31 |
+
,.SE (1'b0) \
|
| 32 |
+
,.Q (bsg_SYNC_2_r[i]) \
|
| 33 |
+
); \
|
| 34 |
+
end \
|
| 35 |
+
\
|
| 36 |
+
endmodule
|
| 37 |
+
|
| 38 |
+
`BSG_ABSTRACT_MODULE(bsg_sync_sync)
|
| 39 |
+
|
| 40 |
+
`bsg_sync_sync_unit_hard(1)
|
| 41 |
+
`bsg_sync_sync_unit_hard(2)
|
| 42 |
+
`bsg_sync_sync_unit_hard(3)
|
| 43 |
+
`bsg_sync_sync_unit_hard(4)
|
| 44 |
+
`bsg_sync_sync_unit_hard(5)
|
| 45 |
+
`bsg_sync_sync_unit_hard(6)
|
| 46 |
+
`bsg_sync_sync_unit_hard(7)
|
| 47 |
+
`bsg_sync_sync_unit_hard(8)
|
| 48 |
+
|
| 49 |
+
// warning: if you make this != 8, you need to modify other
|
| 50 |
+
// parts of this code.
|
| 51 |
+
|
| 52 |
+
`define bss_max_block 8
|
| 53 |
+
|
| 54 |
+
`define bss_if_clause(num) if ((width_p % `bss_max_block) == num) begin: z\
|
| 55 |
+
bsg_sync_sync_``num``_unit bss \
|
| 56 |
+
(.oclk_i \
|
| 57 |
+
,.iclk_data_i(iclk_data_i[width_p-1-:num]) \
|
| 58 |
+
,.oclk_data_o(oclk_data_o[width_p-1-:num]) \
|
| 59 |
+
); end
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
module bsg_sync_sync #(parameter `BSG_INV_PARAM(width_p ))
|
| 63 |
+
(
|
| 64 |
+
input oclk_i
|
| 65 |
+
, input [width_p-1:0] iclk_data_i
|
| 66 |
+
, output [width_p-1:0] oclk_data_o // after sync flops
|
| 67 |
+
);
|
| 68 |
+
|
| 69 |
+
genvar i;
|
| 70 |
+
|
| 71 |
+
for (i = 0; i < (width_p/`bss_max_block); i = i + 1)
|
| 72 |
+
begin : maxb
|
| 73 |
+
bsg_sync_sync_8_unit bss8
|
| 74 |
+
(.oclk_i
|
| 75 |
+
,.iclk_data_i(iclk_data_i[i*`bss_max_block+:`bss_max_block])
|
| 76 |
+
,.oclk_data_o(oclk_data_o[i*`bss_max_block+:`bss_max_block])
|
| 77 |
+
);
|
| 78 |
+
end
|
| 79 |
+
|
| 80 |
+
`bss_if_clause(1) else
|
| 81 |
+
`bss_if_clause(2) else
|
| 82 |
+
`bss_if_clause(3) else
|
| 83 |
+
`bss_if_clause(4) else
|
| 84 |
+
`bss_if_clause(5) else
|
| 85 |
+
`bss_if_clause(6) else
|
| 86 |
+
`bss_if_clause(7)
|
| 87 |
+
|
| 88 |
+
endmodule
|
| 89 |
+
|
| 90 |
+
`BSG_ABSTRACT_MODULE(bsg_sync_sync)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1r1w_sync_mask_write_bit.sv
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// ctorng 2/22/2017
|
| 2 |
+
//
|
| 3 |
+
// 1 read-port, 1 write-port ram
|
| 4 |
+
//
|
| 5 |
+
// reads are synchronous
|
| 6 |
+
//
|
| 7 |
+
// Ports for tsmc16_2rw (sram_2p_uhde)
|
| 8 |
+
//
|
| 9 |
+
// CLK // in
|
| 10 |
+
// AA // in
|
| 11 |
+
// CENA // active low
|
| 12 |
+
// QA // out
|
| 13 |
+
//
|
| 14 |
+
// AB // in
|
| 15 |
+
// DB // in
|
| 16 |
+
// CENB // active low
|
| 17 |
+
// WENB // active low
|
| 18 |
+
//
|
| 19 |
+
// STOVAB// 1'b0 (is really a don't care, but we drive it)
|
| 20 |
+
// STOV // 1'b0 default
|
| 21 |
+
// EMA // 3'd2 default
|
| 22 |
+
// EMAW // 2'd1 default
|
| 23 |
+
// EMAS // 1'b0 default
|
| 24 |
+
// EMAP // 1'b0 default
|
| 25 |
+
// RET1N // 1'b1, active low, 1'b1 is disabled (retention mode)
|
| 26 |
+
//
|
| 27 |
+
|
| 28 |
+
`define bsg_mem_1r1w_sync_mask_write_bit_macro(words,bits,lgEls) \
|
| 29 |
+
if (els_p == words && width_p == bits) \
|
| 30 |
+
begin: macro \
|
| 31 |
+
tsmc16_1r1w_lg``lgEls``_w``bits``_bit mem ( \
|
| 32 |
+
.CLK (clk_i) \
|
| 33 |
+
,.AA (r_addr_i) \
|
| 34 |
+
,.CENA (~r_v_i) \
|
| 35 |
+
,.QA (r_data_o) \
|
| 36 |
+
\
|
| 37 |
+
,.AB (w_addr_i) \
|
| 38 |
+
,.DB (w_data_i) \
|
| 39 |
+
,.CENB (~w_v_i) \
|
| 40 |
+
,.WENB (~w_mask_i) \
|
| 41 |
+
\
|
| 42 |
+
,.STOV (1'd0 ) \
|
| 43 |
+
,.STOVAB(1'd0 ) \
|
| 44 |
+
,.EMA (3'd3 ) \
|
| 45 |
+
,.EMAW (2'd1 ) \
|
| 46 |
+
,.EMAS (1'b0 ) \
|
| 47 |
+
,.EMAP (1'b0 ) \
|
| 48 |
+
,.RET1N (1'b1 ) \
|
| 49 |
+
); \
|
| 50 |
+
end
|
| 51 |
+
|
| 52 |
+
`define bsg_mem_1r1w_sync_mask_write_bit_macro_rf(words,bits,lgEls) \
|
| 53 |
+
if (els_p == words && width_p == bits) \
|
| 54 |
+
begin: macro \
|
| 55 |
+
tsmc16_1r1w_rf_lg``lgEls``_w``bits``_bit mem ( \
|
| 56 |
+
.CLKA (clk_i) \
|
| 57 |
+
,.AA (r_addr_i) \
|
| 58 |
+
,.CENA (~r_v_i) \
|
| 59 |
+
,.QA (r_data_o) \
|
| 60 |
+
\
|
| 61 |
+
,.CLKB (clk_i) \
|
| 62 |
+
,.AB (w_addr_i) \
|
| 63 |
+
,.DB (w_data_i) \
|
| 64 |
+
,.CENB (~w_v_i) \
|
| 65 |
+
,.WENB (~w_mask_i) \
|
| 66 |
+
\
|
| 67 |
+
,.STOV (1'd0 ) \
|
| 68 |
+
,.EMAA (3'd3 ) \
|
| 69 |
+
,.EMAB (3'd3 ) \
|
| 70 |
+
,.EMASA (1'd1 ) \
|
| 71 |
+
,.RET1N (1'b1 ) \
|
| 72 |
+
); \
|
| 73 |
+
end
|
| 74 |
+
|
| 75 |
+
module bsg_mem_1r1w_sync_mask_write_bit #(parameter `BSG_INV_PARAM(width_p)
|
| 76 |
+
, parameter `BSG_INV_PARAM(els_p)
|
| 77 |
+
, parameter read_write_same_addr_p=0
|
| 78 |
+
, parameter addr_width_lp=`BSG_SAFE_CLOG2(els_p)
|
| 79 |
+
, parameter harden_p=1
|
| 80 |
+
)
|
| 81 |
+
( input clk_i
|
| 82 |
+
, input reset_i
|
| 83 |
+
|
| 84 |
+
, input w_v_i
|
| 85 |
+
, input [width_p-1:0] w_mask_i
|
| 86 |
+
, input [addr_width_lp-1:0] w_addr_i
|
| 87 |
+
, input [width_p-1:0] w_data_i
|
| 88 |
+
|
| 89 |
+
// currently unused
|
| 90 |
+
, input r_v_i
|
| 91 |
+
, input [addr_width_lp-1:0] r_addr_i
|
| 92 |
+
|
| 93 |
+
, output logic [width_p-1:0] r_data_o
|
| 94 |
+
);
|
| 95 |
+
|
| 96 |
+
`bsg_mem_1r1w_sync_mask_write_bit_macro(64,88,6) else
|
| 97 |
+
`bsg_mem_1r1w_sync_mask_write_bit_macro(256,128,8) else
|
| 98 |
+
bsg_mem_1r1w_sync_mask_write_bit_synth
|
| 99 |
+
#(.width_p(width_p)
|
| 100 |
+
,.els_p (els_p )
|
| 101 |
+
,.read_write_same_addr_p(read_write_same_addr_p)
|
| 102 |
+
,.harden_p(harden_p)
|
| 103 |
+
) synth
|
| 104 |
+
(.*);
|
| 105 |
+
|
| 106 |
+
`ifndef BSG_HIDE_FROM_SYNTHESIS
|
| 107 |
+
|
| 108 |
+
always_ff @(posedge clk_i)
|
| 109 |
+
if (w_v_i)
|
| 110 |
+
begin
|
| 111 |
+
assert (w_addr_i < els_p)
|
| 112 |
+
else $error("Invalid address %x to %m of size %x\n", w_addr_i, els_p);
|
| 113 |
+
|
| 114 |
+
assert (~(r_addr_i == w_addr_i && w_v_i && r_v_i && !read_write_same_addr_p))
|
| 115 |
+
else
|
| 116 |
+
begin
|
| 117 |
+
//$error("%m: Attempt to read and write same address (reset_i %b, %x <= %x (mask %x) old_val %x",reset_i, w_addr_i,w_data_i,w_mask_i,mem[r_addr_i]);
|
| 118 |
+
$error("%m: Attempt to read and write same address (reset_i %b, %x <= %x (mask %x)",reset_i, w_addr_i,w_data_i,w_mask_i);
|
| 119 |
+
//$finish();
|
| 120 |
+
end
|
| 121 |
+
end
|
| 122 |
+
|
| 123 |
+
initial
|
| 124 |
+
begin
|
| 125 |
+
$display("## %L: instantiating width_p=%d, els_p=%d, read_write_same_addr_p=%d harden_p=%d (%m)",width_p,els_p,read_write_same_addr_p, harden_p);
|
| 126 |
+
end
|
| 127 |
+
|
| 128 |
+
`endif
|
| 129 |
+
|
| 130 |
+
endmodule
|
| 131 |
+
|
| 132 |
+
`BSG_ABSTRACT_MODULE(bsg_mem_1r1w_sync_mask_write_bit)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1rw_sync.sv
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// MBT 11/9/2014
|
| 2 |
+
//
|
| 3 |
+
// Synchronous 1-port ram.
|
| 4 |
+
// Only one read or one write may be done per cycle.
|
| 5 |
+
//
|
| 6 |
+
|
| 7 |
+
`define bsg_mem_1rw_sync_macro(words,bits,lgEls,newBits) \
|
| 8 |
+
if (els_p == words && width_p == bits) \
|
| 9 |
+
begin: macro \
|
| 10 |
+
tsmc16_1rw_lg``lgEls``_w``newBits``_all mem \
|
| 11 |
+
(.CLK (clk_i ) \
|
| 12 |
+
,.Q (data_o) // out \
|
| 13 |
+
,.CEN (~v_i ) // lo true \
|
| 14 |
+
,.GWEN (~w_i ) // lo true \
|
| 15 |
+
,.A (addr_i) // in \
|
| 16 |
+
,.D (data_i) // in \
|
| 17 |
+
,.STOV (1'd0 ) // Self-timing Override - disabled \
|
| 18 |
+
,.EMA (3'd3 ) // Extra Margin Adjustment - default value \
|
| 19 |
+
,.EMAW (2'd1 ) // Extra Margin Adjustment Write - default value \
|
| 20 |
+
,.EMAS (1'd0 ) // Extra Margin Adjustment Sense Amp. - default value \
|
| 21 |
+
,.RET1N (1'b1 ) // Retention Mode (active low) - disabled \
|
| 22 |
+
); \
|
| 23 |
+
end // block: macro
|
| 24 |
+
|
| 25 |
+
`define bsg_mem_1rw_sync_macro_rf(words,bits,lgEls,newBits) \
|
| 26 |
+
if (els_p == words && width_p == bits) \
|
| 27 |
+
begin: macro \
|
| 28 |
+
tsmc16_1rf_lg``lgEls``_w``newBits``_all mem \
|
| 29 |
+
(.Q (data_o) \
|
| 30 |
+
,.CLK (clk_i ) \
|
| 31 |
+
,.CEN (~v_i ) \
|
| 32 |
+
,.GWEN (~w_i ) \
|
| 33 |
+
,.A (addr_i) \
|
| 34 |
+
,.D (data_i) \
|
| 35 |
+
,.STOV (1'd0 ) // Self-timing Override - disabled \
|
| 36 |
+
,.EMA (3'd3 ) // Extra Margin Adjustment - default value \
|
| 37 |
+
,.EMAW (2'd1 ) // Extra Margin Adjustment Write - default value \
|
| 38 |
+
,.EMAS (1'd0 ) // Extra Margin Adjustment Sense Amp. - default value \
|
| 39 |
+
,.RET1N (1'b1 ) // Retention Mode (active low) - disabled \
|
| 40 |
+
); \
|
| 41 |
+
end // block: macro
|
| 42 |
+
|
| 43 |
+
module bsg_mem_1rw_sync #(parameter `BSG_INV_PARAM(width_p)
|
| 44 |
+
,parameter `BSG_INV_PARAM(els_p)
|
| 45 |
+
,parameter addr_width_lp=$clog2(els_p)
|
| 46 |
+
// whether to substitute a 1r1w
|
| 47 |
+
,parameter substitute_1r1w_p=1)
|
| 48 |
+
(input clk_i
|
| 49 |
+
,input reset_i
|
| 50 |
+
,input [width_p-1:0] data_i
|
| 51 |
+
,input [addr_width_lp-1:0] addr_i
|
| 52 |
+
,input v_i
|
| 53 |
+
,input w_i
|
| 54 |
+
,output logic [width_p-1:0] data_o
|
| 55 |
+
);
|
| 56 |
+
|
| 57 |
+
`bsg_mem_1rw_sync_macro (1024, 32, 10, 32) else
|
| 58 |
+
`bsg_mem_1rw_sync_macro_rf (128, 66, 7, 66) else
|
| 59 |
+
`bsg_mem_1rw_sync_macro_rf (128, 62, 7, 62) else
|
| 60 |
+
`bsg_mem_1rw_sync_macro_rf (256, 128, 8, 128) else
|
| 61 |
+
|
| 62 |
+
begin: z
|
| 63 |
+
// we substitute a 1r1w macro
|
| 64 |
+
// fixme: theoretically there may be
|
| 65 |
+
// a more efficient way to generate a 1rw synthesized ram
|
| 66 |
+
if (substitute_1r1w_p)
|
| 67 |
+
begin: s1r1w
|
| 68 |
+
|
| 69 |
+
logic [width_p-1:0] data_lo;
|
| 70 |
+
|
| 71 |
+
bsg_mem_1r1w #(.width_p(width_p)
|
| 72 |
+
,.els_p(els_p)
|
| 73 |
+
,.read_write_same_addr_p(0)
|
| 74 |
+
) mem
|
| 75 |
+
(.w_clk_i (clk_i )
|
| 76 |
+
,.w_reset_i (reset_i )
|
| 77 |
+
,.w_v_i (v_i & w_i )
|
| 78 |
+
,.w_addr_i (addr_i )
|
| 79 |
+
,.w_data_i (data_i )
|
| 80 |
+
,.r_addr_i (addr_i )
|
| 81 |
+
,.r_v_i (v_i & ~w_i)
|
| 82 |
+
,.r_data_o (data_lo )
|
| 83 |
+
);
|
| 84 |
+
|
| 85 |
+
// register output data to convert sync to async
|
| 86 |
+
always_ff @(posedge clk_i)
|
| 87 |
+
data_o <= data_lo;
|
| 88 |
+
|
| 89 |
+
end // block: s1r1w
|
| 90 |
+
else
|
| 91 |
+
begin: notmacro
|
| 92 |
+
|
| 93 |
+
// Instantiate a synthesizable 1rw sync ram
|
| 94 |
+
bsg_mem_1rw_sync_synth #(.width_p(width_p), .els_p(els_p)) synth (.*);
|
| 95 |
+
|
| 96 |
+
end // block: notmacro
|
| 97 |
+
end // block: z
|
| 98 |
+
|
| 99 |
+
`ifndef BSG_HIDE_FROM_SYNTHESIS
|
| 100 |
+
initial
|
| 101 |
+
begin
|
| 102 |
+
$display("## %L: instantiating width_p=%d, els_p=%d, substitute_1r1w_p=%d (%m)",width_p,els_p,substitute_1r1w_p);
|
| 103 |
+
end
|
| 104 |
+
`endif
|
| 105 |
+
|
| 106 |
+
endmodule
|
| 107 |
+
|
| 108 |
+
`BSG_ABSTRACT_MODULE(bsg_mem_1rw_sync)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1rw_sync_mask_write_bit.sv
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// ctorng 2-23-17
|
| 2 |
+
//
|
| 3 |
+
// Synchronous 1-port ram with bit masking
|
| 4 |
+
// Only one read or one write may be done per cycle.
|
| 5 |
+
//
|
| 6 |
+
// Ports for tsmc16_1rw and tsmc16_1rf
|
| 7 |
+
//
|
| 8 |
+
// CLK // in
|
| 9 |
+
// Q // out
|
| 10 |
+
// CEN // lo true
|
| 11 |
+
// WEN // lo true
|
| 12 |
+
// GWEN // lo true
|
| 13 |
+
// A // in
|
| 14 |
+
// D // in
|
| 15 |
+
// STOV // Self-timing Override - disabled
|
| 16 |
+
// EMA // Extra Margin Adjustment - default value
|
| 17 |
+
// EMAW // Extra Margin Adjustment Write - default value
|
| 18 |
+
// EMAS // Extra Margin Adjustment Sense Amp. - default value
|
| 19 |
+
// RET1N // Retention Mode (active low) - disabled
|
| 20 |
+
|
| 21 |
+
`define bsg_mem_1rw_sync_mask_write_bit_macro(words,bits,lgEls) \
|
| 22 |
+
if (els_p == words && width_p == bits) \
|
| 23 |
+
begin: macro \
|
| 24 |
+
tsmc16_1rw_lg``lgEls``_w``bits``_bit mem \
|
| 25 |
+
(.CLK (clk_i ) \
|
| 26 |
+
,.Q (data_o) \
|
| 27 |
+
,.CEN (~v_i ) \
|
| 28 |
+
,.WEN (~w_mask_i) \
|
| 29 |
+
,.GWEN (~w_i ) \
|
| 30 |
+
,.A (addr_i) \
|
| 31 |
+
,.D (data_i) \
|
| 32 |
+
,.STOV (1'd0 ) \
|
| 33 |
+
,.EMA (3'd3 ) \
|
| 34 |
+
,.EMAW (2'd1 ) \
|
| 35 |
+
,.EMAS (1'd0 ) \
|
| 36 |
+
,.RET1N (1'b1 ) \
|
| 37 |
+
); \
|
| 38 |
+
end // block: macro
|
| 39 |
+
|
| 40 |
+
`define bsg_mem_1rw_sync_mask_write_bit_macro_rf(words,bits,lgEls) \
|
| 41 |
+
if (els_p == words && width_p == bits) \
|
| 42 |
+
begin: macro \
|
| 43 |
+
tsmc16_1rf_lg``lgEls``_w``bits``_bit mem \
|
| 44 |
+
(.Q (data_o) \
|
| 45 |
+
,.CLK (clk_i ) \
|
| 46 |
+
,.CEN (~v_i ) \
|
| 47 |
+
,.WEN (~w_mask_i) \
|
| 48 |
+
,.GWEN (~w_i ) \
|
| 49 |
+
,.A (addr_i) \
|
| 50 |
+
,.D (data_i) \
|
| 51 |
+
,.STOV (1'd0 ) \
|
| 52 |
+
,.EMA (3'd3 ) \
|
| 53 |
+
,.EMAW (2'd1 ) \
|
| 54 |
+
,.EMAS (1'd0 ) \
|
| 55 |
+
,.RET1N (1'b1 ) \
|
| 56 |
+
); \
|
| 57 |
+
end // block: macro
|
| 58 |
+
|
| 59 |
+
module bsg_mem_1rw_sync_mask_write_bit #(parameter `BSG_INV_PARAM(width_p)
|
| 60 |
+
, parameter `BSG_INV_PARAM(els_p)
|
| 61 |
+
, parameter addr_width_lp=`BSG_SAFE_CLOG2(els_p))
|
| 62 |
+
(input clk_i
|
| 63 |
+
, input reset_i
|
| 64 |
+
, input [width_p-1:0] data_i
|
| 65 |
+
, input [addr_width_lp-1:0] addr_i
|
| 66 |
+
, input v_i
|
| 67 |
+
, input [width_p-1:0] w_mask_i
|
| 68 |
+
, input w_i
|
| 69 |
+
, output [width_p-1:0] data_o
|
| 70 |
+
);
|
| 71 |
+
|
| 72 |
+
`bsg_mem_1rw_sync_mask_write_bit_macro_rf(64,80,6) else
|
| 73 |
+
bsg_mem_1rw_sync_mask_write_bit_synth
|
| 74 |
+
#(.width_p(width_p)
|
| 75 |
+
,.els_p(els_p)
|
| 76 |
+
) synth
|
| 77 |
+
(.*);
|
| 78 |
+
|
| 79 |
+
`ifndef BSG_HIDE_FROM_SYNTHESIS
|
| 80 |
+
|
| 81 |
+
always_ff @(posedge clk_i)
|
| 82 |
+
if (v_i)
|
| 83 |
+
assert (addr_i < els_p)
|
| 84 |
+
else $error("Invalid address %x to %m of size %x\n", addr_i, els_p);
|
| 85 |
+
|
| 86 |
+
initial
|
| 87 |
+
begin
|
| 88 |
+
$display("## %L: instantiating width_p=%d, els_p=%d (%m)",width_p,els_p);
|
| 89 |
+
end
|
| 90 |
+
|
| 91 |
+
`endif
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
endmodule
|
| 95 |
+
|
| 96 |
+
`BSG_ABSTRACT_MODULE(bsg_mem_1rw_sync_mask_write_bit)
|
| 97 |
+
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_1rw_sync_mask_write_byte.sv
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// STD 10-30-16
|
| 2 |
+
//
|
| 3 |
+
// Synchronous 1-port ram with byte masking
|
| 4 |
+
// Only one read or one write may be done per cycle.
|
| 5 |
+
//
|
| 6 |
+
module bsg_mem_1rw_sync_mask_write_byte #(parameter `BSG_INV_PARAM(els_p )
|
| 7 |
+
,parameter `BSG_INV_PARAM(data_width_p )
|
| 8 |
+
,parameter addr_width_lp = `BSG_SAFE_CLOG2(els_p)
|
| 9 |
+
,parameter write_mask_width_lp = data_width_p>>3
|
| 10 |
+
)
|
| 11 |
+
(input clk_i
|
| 12 |
+
,input reset_i
|
| 13 |
+
,input v_i
|
| 14 |
+
,input w_i
|
| 15 |
+
,input [addr_width_lp-1:0] addr_i
|
| 16 |
+
,input [data_width_p-1:0] data_i
|
| 17 |
+
,input [write_mask_width_lp-1:0] write_mask_i
|
| 18 |
+
,output [data_width_p-1:0] data_o
|
| 19 |
+
);
|
| 20 |
+
|
| 21 |
+
if ((els_p == 1024) & (data_width_p == 32))
|
| 22 |
+
begin : macro
|
| 23 |
+
wire [31:0] wen = ~{{8{write_mask_i[3]}}
|
| 24 |
+
,{8{write_mask_i[2]}}
|
| 25 |
+
,{8{write_mask_i[1]}}
|
| 26 |
+
,{8{write_mask_i[0]}}};
|
| 27 |
+
tsmc16_1rw_lg10_w32_byte mem
|
| 28 |
+
(.CLK (clk_i )
|
| 29 |
+
,.Q (data_o) // out
|
| 30 |
+
,.CEN (~v_i ) // lo true
|
| 31 |
+
,.WEN (wen )
|
| 32 |
+
,.GWEN (~w_i ) // lo true
|
| 33 |
+
,.A (addr_i) // in
|
| 34 |
+
,.D (data_i) // in
|
| 35 |
+
,.STOV (1'd0 ) // Self-timing Override - disabled
|
| 36 |
+
,.EMA (3'd3 ) // Extra Margin Adjustment - default value
|
| 37 |
+
,.EMAW (2'd1 ) // Extra Margin Adjustment Write - default value
|
| 38 |
+
,.EMAS (1'd0 ) // Extra Margin Adjustment Sense Amp. - default value
|
| 39 |
+
,.RET1N (1'b1 ) // Retention Mode (active low) - disabled
|
| 40 |
+
);
|
| 41 |
+
end // block: macro
|
| 42 |
+
|
| 43 |
+
// no hardened version found
|
| 44 |
+
else
|
| 45 |
+
begin: notmacro
|
| 46 |
+
|
| 47 |
+
// Instantiate a synthesizale 1rw sync mask write byte
|
| 48 |
+
bsg_mem_1rw_sync_mask_write_byte_synth #(.els_p(els_p), .data_width_p(data_width_p)) synth (.*);
|
| 49 |
+
|
| 50 |
+
end // block: notmacro
|
| 51 |
+
|
| 52 |
+
`ifndef BSG_HIDE_FROM_SYNTHESIS
|
| 53 |
+
always_comb
|
| 54 |
+
assert (data_width_p % 8 == 0)
|
| 55 |
+
else $error("data width should be a multiple of 8 for byte masking");
|
| 56 |
+
|
| 57 |
+
initial
|
| 58 |
+
begin
|
| 59 |
+
$display("## bsg_mem_1rw_sync_mask_write_byte: instantiating data_width_p=%d, els_p=%d (%m)",data_width_p,els_p);
|
| 60 |
+
end
|
| 61 |
+
`endif
|
| 62 |
+
|
| 63 |
+
endmodule
|
| 64 |
+
|
| 65 |
+
`BSG_ABSTRACT_MODULE(bsg_mem_1rw_sync_mask_write_byte)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_mem/bsg_mem_2r1w_sync.sv
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//
|
| 2 |
+
// 2 read-port, 1 write-port ram
|
| 3 |
+
//
|
| 4 |
+
// reads are synchronous
|
| 5 |
+
//
|
| 6 |
+
//
|
| 7 |
+
|
| 8 |
+
module bsg_mem_2r1w_sync #(parameter `BSG_INV_PARAM(width_p)
|
| 9 |
+
, parameter `BSG_INV_PARAM(els_p)
|
| 10 |
+
, parameter read_write_same_addr_p=0
|
| 11 |
+
, parameter addr_width_lp=`BSG_SAFE_CLOG2(els_p)
|
| 12 |
+
, parameter harden_p=0
|
| 13 |
+
)
|
| 14 |
+
(input clk_i
|
| 15 |
+
, input reset_i
|
| 16 |
+
|
| 17 |
+
, input w_v_i
|
| 18 |
+
, input [addr_width_lp-1:0] w_addr_i
|
| 19 |
+
, input [width_p-1:0] w_data_i
|
| 20 |
+
|
| 21 |
+
// currently unused
|
| 22 |
+
, input r0_v_i
|
| 23 |
+
, input [addr_width_lp-1:0] r0_addr_i
|
| 24 |
+
, output logic [width_p-1:0] r0_data_o
|
| 25 |
+
|
| 26 |
+
, input r1_v_i
|
| 27 |
+
, input [addr_width_lp-1:0] r1_addr_i
|
| 28 |
+
, output logic [width_p-1:0] r1_data_o
|
| 29 |
+
);
|
| 30 |
+
|
| 31 |
+
wire unused = reset_i;
|
| 32 |
+
|
| 33 |
+
if ((width_p == 32) && (els_p == 32))
|
| 34 |
+
begin: macro
|
| 35 |
+
|
| 36 |
+
tsmc16_2rf_lg5_w32_all mem0
|
| 37 |
+
(
|
| 38 |
+
// read port
|
| 39 |
+
.CLKA (clk_i)
|
| 40 |
+
,.AA (r0_addr_i)
|
| 41 |
+
,.CENA(~r0_v_i)
|
| 42 |
+
|
| 43 |
+
// output
|
| 44 |
+
,.QA (r0_data_o)
|
| 45 |
+
|
| 46 |
+
// write port
|
| 47 |
+
,.CLKB(clk_i)
|
| 48 |
+
,.AB (w_addr_i)
|
| 49 |
+
,.DB (w_data_i)
|
| 50 |
+
,.CENB(~w_v_i)
|
| 51 |
+
|
| 52 |
+
,.STOV (1'd0 ) // Self-timing Override - disabled
|
| 53 |
+
,.EMAA (3'd3 ) // Extra Margin Adjustment - default value
|
| 54 |
+
,.EMAB (3'd3 ) // Extra Margin Adjustment - default value
|
| 55 |
+
,.EMASA(1'd1 ) // Extra Margin Adjustment Sense Amp. - default value
|
| 56 |
+
,.RET1N(1'b1 ) // Retention Mode (active low) - disabled
|
| 57 |
+
);
|
| 58 |
+
|
| 59 |
+
tsmc16_2rf_lg5_w32_all mem1
|
| 60 |
+
(
|
| 61 |
+
.CLKA (clk_i)
|
| 62 |
+
,.AA (r1_addr_i)
|
| 63 |
+
,.CENA(~r1_v_i)
|
| 64 |
+
|
| 65 |
+
// output
|
| 66 |
+
,.QA (r1_data_o)
|
| 67 |
+
|
| 68 |
+
// write port
|
| 69 |
+
,.CLKB(clk_i)
|
| 70 |
+
,.AB (w_addr_i)
|
| 71 |
+
,.DB (w_data_i)
|
| 72 |
+
,.CENB(~w_v_i)
|
| 73 |
+
|
| 74 |
+
,.STOV (1'd0 ) // Self-timing Override - disabled
|
| 75 |
+
,.EMAA (3'd3 ) // Extra Margin Adjustment - default value
|
| 76 |
+
,.EMAB (3'd3 ) // Extra Margin Adjustment - default value
|
| 77 |
+
,.EMASA(1'd1 ) // Extra Margin Adjustment Sense Amp. - default value
|
| 78 |
+
,.RET1N(1'b1 ) // Retention Mode (active low) - disabled
|
| 79 |
+
);
|
| 80 |
+
|
| 81 |
+
end // block: macro
|
| 82 |
+
else
|
| 83 |
+
begin: notmacro
|
| 84 |
+
|
| 85 |
+
bsg_mem_2r1w_sync_synth
|
| 86 |
+
#(.width_p(width_p)
|
| 87 |
+
,.els_p(els_p)
|
| 88 |
+
,.read_write_same_addr_p(read_write_same_addr_p)
|
| 89 |
+
,.harden_p(harden_p)
|
| 90 |
+
) synth
|
| 91 |
+
(.*);
|
| 92 |
+
end
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
`ifndef BSG_HIDE_FROM_SYNTHESIS
|
| 96 |
+
|
| 97 |
+
always_ff @(posedge clk_i)
|
| 98 |
+
if (w_v_i)
|
| 99 |
+
begin
|
| 100 |
+
assert (w_addr_i < els_p)
|
| 101 |
+
else $error("Invalid address %x to %m of size %x\n", w_addr_i, els_p);
|
| 102 |
+
|
| 103 |
+
assert (~(r0_addr_i == w_addr_i && w_v_i && r0_v_i && !read_write_same_addr_p))
|
| 104 |
+
else $error("%m: port 0 Attempt to read and write same address");
|
| 105 |
+
|
| 106 |
+
assert (~(r1_addr_i == w_addr_i && w_v_i && r1_v_i && !read_write_same_addr_p))
|
| 107 |
+
else $error("%m: port 1 Attempt to read and write same address");
|
| 108 |
+
end
|
| 109 |
+
|
| 110 |
+
initial
|
| 111 |
+
begin
|
| 112 |
+
$display("## %L: instantiating width_p=%d, els_p=%d, read_write_same_addr_p=%d, harden_p=%d (%m)"
|
| 113 |
+
,width_p,els_p,read_write_same_addr_p,harden_p);
|
| 114 |
+
end
|
| 115 |
+
|
| 116 |
+
`endif
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
endmodule
|
| 121 |
+
|
| 122 |
+
`BSG_ABSTRACT_MODULE(bsg_mem_2r1w_sync)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_misc/bsg_level_shift_up_down_sink.sv
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// bsg_level_shift_up_down_sink
|
| 2 |
+
//
|
| 3 |
+
// An up-down level shifter can transform a signal to a higher or lower
|
| 4 |
+
// voltage. A sink level shifter is designed to be in the same power
|
| 5 |
+
// domain as the signals destination.
|
| 6 |
+
//
|
| 7 |
+
// Author: Scott Davidson
|
| 8 |
+
// Date: 4-4-17
|
| 9 |
+
//
|
| 10 |
+
module bsg_level_shift_up_down_sink #(parameter `BSG_INV_PARAM(width_p ))
|
| 11 |
+
(
|
| 12 |
+
input [width_p-1:0] v0_data_i,
|
| 13 |
+
input v1_en_i,
|
| 14 |
+
output logic [width_p-1:0] v1_data_o
|
| 15 |
+
);
|
| 16 |
+
|
| 17 |
+
genvar i;
|
| 18 |
+
|
| 19 |
+
for (i = 0; i < width_p; i++)
|
| 20 |
+
begin : n
|
| 21 |
+
|
| 22 |
+
A2LVLU_X2N_A7P5PP96PTS_C18 level_shift_sink (
|
| 23 |
+
.EN(v1_en_i), // active high
|
| 24 |
+
.A(v0_data_i[i]),
|
| 25 |
+
.Y(v1_data_o[i])
|
| 26 |
+
);
|
| 27 |
+
|
| 28 |
+
end : n
|
| 29 |
+
|
| 30 |
+
endmodule
|
| 31 |
+
|
| 32 |
+
`BSG_ABSTRACT_MODULE(bsg_level_shift_up_down_sink)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_misc/bsg_level_shift_up_down_source.sv
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// bsg_level_shift_up_down_source
|
| 2 |
+
//
|
| 3 |
+
// An up-down level shifter can transform a signal to a higher or lower
|
| 4 |
+
// voltage. A source level shifter is designed to be in the same power
|
| 5 |
+
// domain as the signals source.
|
| 6 |
+
//
|
| 7 |
+
// Author: Scott Davidson
|
| 8 |
+
// Date: 4-4-17
|
| 9 |
+
//
|
| 10 |
+
module bsg_level_shift_up_down_source #(parameter `BSG_INV_PARAM(width_p ))
|
| 11 |
+
(
|
| 12 |
+
input v0_en_i,
|
| 13 |
+
input [width_p-1:0] v0_data_i,
|
| 14 |
+
output logic [width_p-1:0] v1_data_o
|
| 15 |
+
);
|
| 16 |
+
|
| 17 |
+
genvar i;
|
| 18 |
+
|
| 19 |
+
for (i = 0; i < width_p; i++)
|
| 20 |
+
begin : n
|
| 21 |
+
|
| 22 |
+
A2LVLUO_X2N_A7P5PP96PTS_C18 level_shift_source (
|
| 23 |
+
.EN(v0_en_i), // active high
|
| 24 |
+
.A(v0_data_i[i]),
|
| 25 |
+
.Y(v1_data_o[i])
|
| 26 |
+
);
|
| 27 |
+
|
| 28 |
+
end : n
|
| 29 |
+
|
| 30 |
+
endmodule
|
| 31 |
+
|
| 32 |
+
`BSG_ABSTRACT_MODULE(bsg_level_shift_up_down_source)
|
snapshots/bespoke-silicon-group_basejump_stl_pr706/hard/tsmc_16/bsg_misc/bsg_mux.sv
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module bsg_mux #(
|
| 2 |
+
parameter `BSG_INV_PARAM(width_p ),
|
| 3 |
+
parameter `BSG_INV_PARAM(els_p ),
|
| 4 |
+
parameter harden_p = 1,
|
| 5 |
+
parameter balanced_p = 0,
|
| 6 |
+
parameter lg_els_lp = `BSG_SAFE_CLOG2(els_p)
|
| 7 |
+
) (
|
| 8 |
+
input [els_p-1:0][width_p-1:0] data_i,
|
| 9 |
+
input [lg_els_lp-1:0] sel_i,
|
| 10 |
+
output [width_p-1:0] data_o
|
| 11 |
+
);
|
| 12 |
+
|
| 13 |
+
if (harden_p && balanced_p && (els_p==2) && (width_p==1))
|
| 14 |
+
begin: macro
|
| 15 |
+
|
| 16 |
+
logic lo;
|
| 17 |
+
|
| 18 |
+
// This cell has great edge balancing characteristics
|
| 19 |
+
// on pins B and D if A=1 and C=1
|
| 20 |
+
MXIT4_X2N_A7P5PP96PTS_C16 mxit4 (
|
| 21 |
+
.A(1'b1),
|
| 22 |
+
.B(data_i[0]),
|
| 23 |
+
.C(1'b1),
|
| 24 |
+
.D(data_i[1]),
|
| 25 |
+
.S0(1'b1),
|
| 26 |
+
.S1(sel_i[0]),
|
| 27 |
+
.Y(lo)
|
| 28 |
+
);
|
| 29 |
+
|
| 30 |
+
INV_X16N_A7P5PP96PTS_C16 inv (
|
| 31 |
+
.A(lo),
|
| 32 |
+
.Y(data_o)
|
| 33 |
+
);
|
| 34 |
+
|
| 35 |
+
end: macro
|
| 36 |
+
else
|
| 37 |
+
begin: notmacro
|
| 38 |
+
initial assert (harden_p==0) else $error("## %m: warning, failed to harden bsg_mux width=%d, els=%d, balanced=%d",width_p, els_p, balanced_p);
|
| 39 |
+
assign data_o = data_i[sel_i];
|
| 40 |
+
end: notmacro
|
| 41 |
+
|
| 42 |
+
endmodule
|
| 43 |
+
|
| 44 |
+
`BSG_ABSTRACT_MODULE(bsg_mux)
|
| 45 |
+
|