cam_top.v 872 Bytes
Newer Older
Antoine Kaufmann's avatar
Antoine Kaufmann committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
module cam_top #(
    parameter C_DEPTH = 16,
    parameter ADDR_BITS = 4,
    parameter C_WIDTH = 205,
    parameter C_MEM_INIT = 0
) (
    input CLK,
    input RST,
    input [(C_WIDTH-1):0] CMP_DIN,
    input CMP_DATA_MASK,
    output BUSY,
    output MATCH,
    output [(ADDR_BITS - 1):0] MATCH_ADDR,

    input WE,
    input [(ADDR_BITS - 1):0] WR_ADDR,
    input DATA_MASK,
    input [(C_WIDTH-1):0] DIN,
    input EN
);

    cam_simple #(
        .DATA_WIDTH(C_WIDTH),
        .ADDR_WIDTH(ADDR_BITS),
        .SLICE_WIDTH(9)
    ) cam (
        .clk(CLK),
        .rst(RST),

        .write_addr(WR_ADDR),
        .write_data(DIN),
        .write_delete(0),
        .write_enable(WE),
        .write_busy(BUSY),

        .compare_data(CMP_DIN),
        .match_many(),
        .match_single(),
        .match_addr(MATCH_ADDR),
        .match(MATCH)
    );
endmodule