A method and system for sharing RAM based on HASH search mode
A look-up table and base address technology, applied in the field of computer communication, can solve the problems of not having the function of adjusting the size of entries, complicated design and use, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0047] see figure 1 As shown, the embodiment of the present invention provides a method for sharing RAM based on the HASH search method, including the following steps:
[0048] S1, obtain the number of entries and the entry bit width of the lookup entries contained in each lookup table type, determine the required shared RAM bit width according to the entry bit width of each lookup table type, and the shared RAM bit width is not less than the maximum value of the entry bit width; A lookup table type includes multiple lookup entries, and each lookup entry includes an entry effective identifier, a key value and a lookup result.
[0049] S2, according to the shared RAM bit width determined in S1 and the number of entries of each look-up table type, calculate the RAM depth corresponding to each look-up table type, and determine the required shared RAM depth;
[0050] S3, configure the base address of each table lookup type in the shared RAM, the configured base address is any add...
Embodiment 2
[0057] On the basis of embodiment 1, assume that 4 kinds of look-up table types are needed in a certain design requirement: the entry bit width of the first look-up table type is 50, and the number of entries is 256; the entry bit width of the second look-up table type is 65, The number of entries is 2048, the entry bit width of the third lookup table type is 80, the number of entries is 4096, the entry bit width of the fourth lookup table type is 180; the number of entries is 512.
[0058] Step S1 specifically includes the following processes:
[0059] 1. Calculate according to the method of determining the RAM bit width and the number of comparisons required for each search:
[0060] Set the required shared RAM bit width to 200 bits, and continue to calculate the following table based on the shared RAM bit width:
[0061] Each lookup table type
Parallel table lookup times m
Figure out the required RAM depth
1
4
64(256 / 4=64)
2
3
1024...
Embodiment 3
[0072] On the basis of embodiment 1, step S4 is also included after step S3:
[0073] When configuring the lookup entry in the shared RAM, perform HASH calculation based on the keyword value of the lookup entry to be configured, and take the calculation result according to the number of digits of the hash result of the lookup table type to which the lookup entry belongs, plus the lookup The base address of the lookup table type to which the entry belongs is used as the RAM address of the entry to be written in the shared RAM; the keyword value of the lookup entry to be configured and the corresponding table lookup result are configured to the RAM address of the entry to be written in the shared RAM , and configure the entry valid flag of the search entry to be valid.
[0074] The key value of the search entry to be configured and the table lookup result are configured to the RAM address of the entry to be written in the shared RAM, and the configuration entry is effectively ma...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


