[go: up one dir, main page]

TW202006565A - Apparatus and method for searching linked lists - Google Patents

Apparatus and method for searching linked lists Download PDF

Info

Publication number
TW202006565A
TW202006565A TW107123751A TW107123751A TW202006565A TW 202006565 A TW202006565 A TW 202006565A TW 107123751 A TW107123751 A TW 107123751A TW 107123751 A TW107123751 A TW 107123751A TW 202006565 A TW202006565 A TW 202006565A
Authority
TW
Taiwan
Prior art keywords
search
link
node
tandem
processing unit
Prior art date
Application number
TW107123751A
Other languages
Chinese (zh)
Other versions
TWI727185B (en
Inventor
邱慎廷
李聯育
Original Assignee
慧榮科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to TW107123751A priority Critical patent/TWI727185B/en
Priority to CN201811194779.XA priority patent/CN110704330B/en
Publication of TW202006565A publication Critical patent/TW202006565A/en
Application granted granted Critical
Publication of TWI727185B publication Critical patent/TWI727185B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System (AREA)

Abstract

An apparatus for searching linked lists includes: a memory, a linked-list search engine and a processing unit. The memory stores a linked list. The linked-list search engine searches the content of the linked list until a success or a fail, and accordingly generates a search result. The processing unit writes the content of the linked list in the memory, drives the linked list search engine to start a search operation to the linked list and obtains the search result from the linked-list search engine.

Description

鏈結串列搜索裝置及方法Link tandem search device and method

本發明涉及計算機裝置,尤指一種鏈結串列搜索裝置及方法。The invention relates to a computer device, in particular to a link tandem search device and method.

鏈結串列是一種資料結構,包含多個節點,集合起來成為一個串列。這是一種資料單元的線性集合,而它的順序並不是記憶體中的實際擺放順序,反而,每個單元會指向自己的下一個單元。通常,每個節點包含資料及指向序列中下個節點的參考位置(也就是鏈結)。這樣的結構允許有效率地在序列中任意位置插入或移除元件。傳統上,鏈結串列的搜索是由中央處理單元執行,而中央處理單元又通常是計算機系統的核心。減少使用中央處理單元搜索鏈結串列中的資料可提升系統的整體效能。因此,本發明提出一種鏈結串列搜索裝置及方法,使用專用硬體來取代中央處理單元進行鏈結串列中的資料搜索,提升計算機系統的整體效能。Linked tandem is a data structure that contains multiple nodes, which are aggregated into a tandem. This is a linear collection of data units, and its order is not the actual placement order in the memory. Instead, each unit will point to its next unit. Generally, each node contains data and a reference position (that is, link) that points to the next node in the sequence. Such a structure allows for efficient insertion or removal of elements at any position in the sequence. Traditionally, chained search is performed by the central processing unit, which is usually the core of the computer system. Reducing the use of the central processing unit to search the data in the link list can improve the overall performance of the system. Therefore, the present invention proposes a link serial search device and method, which uses dedicated hardware to replace the central processing unit to search the data in the link serial to improve the overall performance of the computer system.

有鑑於此,如何減輕或消除上述相關領域的缺失,實為有待解決的問題。In view of this, how to mitigate or eliminate the above-mentioned deficiencies in related fields is really a problem to be solved.

本說明書提供一種鏈結串列搜索裝置的實施例,其包含:記憶體、鏈結串列搜索引擎及處理單元。記憶體儲存鏈結串列。鏈結串列搜索引擎搜索鏈結串列的內容直到搜索成功或搜索失敗為止,及產生一搜索結果。處理單元寫入鏈結串列的內容至記憶體,驅動鏈結串列搜索引擎開始鏈結串列的搜索作業,並且從鏈結串列搜索引擎取得搜索結果。This specification provides an embodiment of a link tandem search device, which includes: a memory, a link tandem search engine, and a processing unit. The memory storage chain is serial. The link search engine searches the contents of the link list until the search succeeds or fails, and generates a search result. The processing unit writes the contents of the link string to the memory, drives the link string search engine to start the link string search operation, and obtains the search results from the link string search engine.

本說明書另提供一種鏈結串列搜索方法的實施例,由鏈結串列搜索引擎執行,其包含:從配置寄存器取得由處理單元設定的鏈結串列的起始節點的記憶體位址,以及搜索值;反覆執行一迴圈,用以從起始節點開始依序取得並處理鏈結串列中的多個節點,直到搜索成功或搜索失敗為止;當搜索成功時,儲存搜索結果及搜索成功的資訊,使得處理單元取得搜索結果及搜索成功的資訊;以及當搜索失敗時,儲存搜索失敗的資訊,使得處理單元取得搜索失敗的資訊。This specification also provides an embodiment of a link tandem search method, which is executed by a link tandem search engine and includes: obtaining the memory address of the start node of the link tandem set by the processing unit from a configuration register, and Search value; repeatedly execute a loop to sequentially acquire and process multiple nodes in the link sequence from the starting node until the search is successful or the search fails; when the search is successful, the search results and the search are successful Information, so that the processing unit obtains the search results and the information of the search success; and when the search fails, the information of the search failure is stored, so that the processing unit obtains the information of the search failure.

上述實施例的優點之一,通過處理單元及鏈結串列搜索引擎間的協同合作,鏈結串列的搜索作業可與其他任務並行處理,提升電子裝置的整體效能。One of the advantages of the above embodiments is that, through the cooperation between the processing unit and the chained search engine, the chained search operation can be processed in parallel with other tasks, improving the overall performance of the electronic device.

本發明的其他優點將搭配以下的說明和圖式進行更詳細的解說。Other advantages of the present invention will be explained in more detail with the following description and drawings.

以下說明為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。The following description is a preferred implementation of the invention, and its purpose is to describe the basic spirit of the invention, but it is not intended to limit the invention. The actual content of the invention must refer to the scope of the following claims.

必須了解的是,使用於本說明書中的”包含”、”包括”等詞,用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。It must be understood that the words "comprising", "including", etc. used in this specification are used to indicate the existence of specific technical features, values, method steps, work processes, components and/or components, but do not exclude the addition of More technical features, values, method steps, job processing, components, components, or any combination of the above.

於權利要求中使用如”第一”、"第二"、"第三"等詞是用來修飾權利要求中的元件,並非用來表示之間具有優先順序,前置關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。The terms such as "first", "second", and "third" are used in the claims to modify the elements in the claims, not to indicate that there is a priority order, pre-relationship, or an element Prior to another component, or the time sequence when performing method steps, is only used to distinguish components with the same name.

參考圖1。鏈結串列搜索裝置可包含處理單元110、記憶體130及鏈結串列搜索引擎150。鏈結串列搜索裝置可實施於NAND快閃記憶裝置,或其他電子裝置,用以提供更有效率的邏輯實體位置轉換等功能。處理單元110可使用多種方式實施,例如使用通用硬體,如單一處理器、具平行處理能力的多處理器、圖形處理器、輕簡型通用目的處理器(lightweight general-purpose processor)或其他具運算能力的處理器,並且在執行指令(instructions)、宏碼(macrocode)或微碼(microcode)時,提供邏輯實體位置轉換的功能。記憶體130可為動態隨機存取記憶體(dynamic random access memory, DRAM)、靜態隨機存取記憶體(static random access memory, SRAM)或其他類型的揮發性記憶體(volatile memory)。需注意的是,以下所述處理單元110的動作或作業為執行特定韌體時完成,為求簡潔不再贅述。處理單元110耦接記憶體130,寫入鏈結串列131的內容至記憶體130。由於鏈結串列131的搜索會耗費一段時間,實施例的鏈結串列搜索裝置使用鏈結串列搜索引擎150完成搜索作業,避免消耗處理單元110的運算能力。鏈結串列搜索引擎150為專屬硬體,耦接記憶體130,用以搜索鏈結串列131的內容直到搜索成功或搜索失敗為止,並產生搜索結果。搜索結果可儲存於記憶體130中的事先分配區域,或者是專屬的寄存器(未顯示於圖1)。此外,為了讓鏈結串列搜索引擎150可於多樣的鏈結串列131中搜索資料,鏈結串列搜索裝置可提供配置寄存器(configuration register)170,用以儲存鏈結串列131中每個節點的資料結構、欲搜索的第一個節點的記憶體位址、搜索方向及欲搜索的值等資訊。配置寄存器170可整合到鏈結串列搜索引擎150中,本發明並不因此受限。處理單元110耦接配置寄存器170,可透過設定配置寄存器170通知鏈結串列搜索引擎150如何搜索鏈結串列131的內容。處理單元110寫入鏈結串列131的內容後,驅動鏈結串列搜索引擎150開始鏈結串列131的搜索作業,並且從鏈結串列搜索引擎150取得搜索結果。Refer to Figure 1. The link serial search device may include a processing unit 110, a memory 130, and a link serial search engine 150. Linked serial search devices can be implemented in NAND flash memory devices, or other electronic devices, to provide more efficient logical physical position conversion and other functions. The processing unit 110 can be implemented in various ways, for example, using general-purpose hardware, such as a single processor, a multiprocessor with parallel processing capabilities, a graphics processor, a lightweight general-purpose processor or other tools A processor with computing power, and when executing instructions, macrocode or microcode, it provides the function of logical entity position conversion. The memory 130 may be a dynamic random access memory (DRAM), a static random access memory (SRAM), or other types of volatile memory (volatile memory). It should be noted that the actions or operations of the processing unit 110 described below are completed when executing specific firmware, and will not be repeated for brevity. The processing unit 110 is coupled to the memory 130 and writes the contents of the link series 131 to the memory 130. Since the search of the link string 131 takes a period of time, the link string search device of the embodiment uses the link string search engine 150 to complete the search operation, so as not to consume the computing power of the processing unit 110. The link serial search engine 150 is dedicated hardware, coupled to the memory 130, and is used to search the contents of the link serial 131 until the search succeeds or fails, and generates search results. The search results can be stored in a pre-allocated area in the memory 130 or a dedicated register (not shown in FIG. 1). In addition, in order for the link serial search engine 150 to search data in various link serials 131, the link serial search device may provide a configuration register 170 for storing each link in the link serial 131 The data structure of each node, the memory address of the first node to be searched, the search direction, and the value to be searched. The configuration register 170 can be integrated into the link tandem search engine 150, and the present invention is not limited thereby. The processing unit 110 is coupled to the configuration register 170, and can notify the link serial search engine 150 how to search the content of the link serial 131 by setting the configuration register 170. After the processing unit 110 writes the content of the link string 131, the link string search engine 150 is driven to start the search operation of the link string 131, and the search result is obtained from the link string search engine 150.

參考圖2。此方法由鏈結串列搜索引擎150執行。鏈結串列搜索引擎150從配置寄存器170取得欲搜索的第一個節點(又可稱為起始節點)的記憶體位址及欲搜索的值(步驟S210)。接著,鏈結串列搜索引擎150反覆執行一個迴圈(步驟S230、S250及S270),用以從起始節點開始依序取得並處理鏈結串列131中的節點,直到搜索成功(步驟S230中”是”的路徑)或搜索失敗(步驟S250中”是”的路徑)為止。於每個回合從記憶體130取得第一個或下一個節點後(步驟S210或S270),判斷取得節點中是否包含處理單元110欲搜索的值(步驟S230)。若搜索成功(步驟S230中“是“的路徑),則鏈結串列搜索引擎150儲存搜索結果及搜索成功的資訊,使得處理單元110可取得搜索結果及搜索成功的資訊(步驟S240),搜索結果可包含搜索到節點的記憶體位址、對應結果及搜索次數等資訊。若搜索失敗(步驟S230中“否“的路徑),判斷此節點是否為最後一個節點(步驟S250)。若已經到達最後一個節點(步驟S250中“是“的路徑),則鏈結串列搜索引擎150儲存搜索失敗的資訊,使得處理單元110可取得搜索失敗的資訊(步驟S260)。若尚未到達最後一個節點(步驟S250中“否“的路徑),則鏈結串列搜索引擎150依據此節點的下一節點位址從記憶體130讀取下一個節點的內容(步驟S270)。鏈結串列中每一節點的內容,以及搭配不同的硬體電路的搜索細節,將描述如後。Refer to Figure 2. This method is executed by the chained search engine 150. The link tandem search engine 150 obtains the memory address of the first node (also called the starting node) to be searched and the value to be searched from the configuration register 170 (step S210). Next, the link series search engine 150 repeatedly executes a loop (steps S230, S250, and S270) to sequentially acquire and process the nodes in the link series 131 from the starting node until the search is successful (step S230 "Yes" path) or search failure ("Yes" path in step S250). After acquiring the first or next node from the memory 130 each round (step S210 or S270), it is determined whether the acquired node contains the value to be searched by the processing unit 110 (step S230). If the search is successful ("Yes" path in step S230), the link tandem search engine 150 stores the search results and information on the search success, so that the processing unit 110 can obtain the search results and the information on the search success (step S240), search The result may include information such as the memory address of the searched node, the corresponding result, and the number of searches. If the search fails ("No" path in step S230), it is determined whether this node is the last node (step S250). If the last node has been reached ("Yes" path in step S250), the chained search engine 150 stores the information about the search failure, so that the processing unit 110 can obtain the information about the search failure (step S260). If the last node has not been reached (the "No" path in step S250), the link tandem search engine 150 reads the content of the next node from the memory 130 according to the next node address of this node (step S270). The content of each node in the chain and the search details with different hardware circuits will be described as follows.

需注意的是,所屬技術領域具有通常知識者可修改圖2,用以讓鏈結串列的搜索從最後一個節點(又可稱為起始節點)開始向前搜索,直到搜索成功或搜索失敗為止。It should be noted that those with ordinary knowledge in the technical field can modify Fig. 2 to make the search of the link list start from the last node (also called the starting node) until the search is successful or the search fails until.

於一些實施例,當鏈結串列搜索引擎150搜索鏈結串列131期間,處理單元110可並行處理其他任務(tasks)並且於一段時間後訪問記憶體130或專屬寄存器以嘗試取得搜索結果。當記憶體130還沒有結果時,處理單元110可先轉去處理其他任務,並於下一段時間後再做檢查。於另一些實施例,鏈結串列搜索引擎150搜索完成後,可發出訊號(如中斷訊號)給處理單元110,使得處理單元110可開始取得搜索結果。於更另一些實施例,鏈結串列搜索引擎150搜索完成後,可透過設定狀態寄存器(status register,未顯示於圖1)通知處理單元110有關搜索結果的訊息。處理單元110可週期性訪問狀態寄存器,並且於狀態寄存器被設定時,取得搜索結果。通過處理單元110及鏈結串列搜索引擎150間的協同合作,鏈結串列131的搜索作業可與其他任務並行處理,提升電子裝置的整體效能。也就是說,鏈結串列搜索引擎150搜索鏈結串列131內容的期間,處理單元110並行地執行任務。In some embodiments, when the link serial search engine 150 searches the link serial 131, the processing unit 110 may process other tasks in parallel and access the memory 130 or the dedicated register after a period of time to try to obtain the search result. When there is no result in the memory 130, the processing unit 110 may first transfer to other tasks and check again after a period of time. In other embodiments, after the search of the link serial search engine 150 is completed, a signal (such as an interrupt signal) may be sent to the processing unit 110, so that the processing unit 110 may start to obtain search results. In still other embodiments, after the search of the link serial search engine 150 is completed, the processing unit 110 may be notified of the search result information through a status register (not shown in FIG. 1). The processing unit 110 may periodically access the status register, and obtain the search result when the status register is set. Through the cooperation between the processing unit 110 and the link serial search engine 150, the search operation of the link serial 131 can be processed in parallel with other tasks, improving the overall performance of the electronic device. That is, while the link serial search engine 150 searches the content of the link serial 131, the processing unit 110 executes tasks in parallel.

由於NAND快閃記憶裝置並非隨機存取裝置,為了提升寫入的效率,主裝置(未顯示於圖1)可提供至少一個長度的連續性資料,例如128K位元組的資料,使得快閃記憶裝置可以有效率的並行作業方式將資料寫入其中的數個儲存子單元。當成功寫入一個邏輯位置的使用者資料後,快閃記憶裝置更新暫存於記憶體130的臨時實體儲存對照表(temporary storage mapping table)中此邏輯位置及寫入實體位置的對應關係資訊。此外,於成功寫入預定數量的邏輯位置的的使用者資料後,依據暫存的臨時實體儲存對照表的內容更新非揮發性的快閃記憶單元(未顯示於圖1)儲存的實體儲存對照表(storage mapping table,又稱為H2F Host-to-Flash表)。參考圖4。實體儲存對照表410依照順序儲存相應於每一邏輯位置的實體位置資訊。實體儲存對照表410所需的空間從64M到1G位元組不等。邏輯位置可以邏輯區塊位址(Logical Block Address LBA)表示,每一個LBA對應到一個固定大小的實體儲存空間,例如512位元組(Bytes)。舉例來說,實體儲存對照表410依序儲存從LBA0至LBA65535的實體位置資訊。數個連續邏輯位置(例如LBA0至LBA7)的資料可形成一個主頁面(host page)。實體位置資訊430可以四個位元組表示:前二個位元組430-0紀錄實體區塊編號(physical block number);後二個位元組430-1紀錄單元編號(unit number)。例如,相應於邏輯位置LBA2的實體位置資訊430可指向實體區塊450中的一個實體區域451。位元組430-0紀錄實體區塊450的編號,位元組430-1紀錄實體區域451的單元編號。Since the NAND flash memory device is not a random access device, in order to improve the efficiency of writing, the master device (not shown in FIG. 1) can provide at least one length of continuous data, such as 128K bytes of data, so that the flash memory The device can write data into several storage subunits in an efficient parallel operation mode. After successfully writing the user data in a logical location, the flash memory device updates the correspondence between the logical location and the written physical location in the temporary storage mapping table temporarily stored in the memory 130. In addition, after successfully writing user data of a predetermined number of logical locations, the non-volatile flash memory unit (not shown in FIG. 1) is updated according to the contents of the temporary temporary physical storage comparison table. Table (storage mapping table, also known as H2F Host-to-Flash table). Refer to Figure 4. The physical storage comparison table 410 sequentially stores physical location information corresponding to each logical location. The space required for the physical storage comparison table 410 varies from 64M to 1G bytes. The logical position can be represented by a logical block address (Logical Block Address LBA), and each LBA corresponds to a fixed-size physical storage space, such as 512 bytes. For example, the physical storage comparison table 410 sequentially stores physical location information from LBA0 to LBA65535. Data from several consecutive logical locations (such as LBA0 to LBA7) can form a host page. The physical location information 430 can be represented by four bytes: the first two bytes 430-0 record the physical block number (physical block number); the last two bytes 430-1 record the unit number (unit number). For example, the physical location information 430 corresponding to the logical location LBA2 may point to a physical area 451 in the physical block 450. Byte 430-0 records the number of the physical block 450, and byte 430-1 records the unit number of the physical area 451.

由於NAND快閃記憶裝置常從主裝置接收到一定順序的主頁面讀取請求,鏈結串列搜索裝置可用以加快這些主頁面的邏輯實體位置轉換。參考圖3。鏈結串列131可包含10個節點300至390,每個節點可儲存長字組(long word)的資料,也就是16個位元組的資料。於每個節點,第0至3位元組儲存指向前一個節點的記憶體位址(又稱為前一節點位址),第4至7位元組儲存指向下一個節點的記憶體位址(又稱為下一節點位址),第8至11位元組儲存主頁面編號,第12至15位元組儲存相應的實體位置資訊。前一節點位址可儲存虛假值(NULL值,例如0xFFFFFFFF)用以指出此節點為鏈結串列的第一個節點,下一節點位址可儲存虛假值用以指出此節點為鏈結串列的最後一個節點。例如,節點300及390分別為鏈結串列的第一個及最後一個節點。節點300的起始位址為0x00000000,節點310的起始位址為0x00000010,依此類推。節點300的下一節點位址指向記憶體位址0x00000010(也就是節點310的起始位址),節點310的下一節點位址指向記憶體位址0x00000020(也就是節點320的起始位址),依此類推。節點390的前一節點位址指向記憶體位址0x00000080(也就是節點380的起始位址),節點380的前一節點位址指向記憶體位址0x00000070(也就是節點370的起始位址),依此類推。節點300儲存的主頁面標號為0x00000033且相應的實體位置資訊為變數PA0,節點310儲存的主頁面標號為0x00000044且相應的實體位置資訊為變數PA1,依此類推,變數PA0至PA9的值由處理單元110填寫。雖然本發明的實施例將鏈結串列131的節點200及290依據記憶體130的位址順序性安排以方便於閱讀,但是,經過數次的插入及刪除後,節點300及390的順序通常不相符於記憶體130的位址順序。Since NAND flash memory devices often receive a certain sequence of main page read requests from the main device, the link tandem search device can be used to speed up the logical physical location conversion of these main pages. Refer to Figure 3. The link series 131 may include 10 nodes 300 to 390, and each node may store long word data, that is, 16-byte data. For each node, bytes 0 to 3 store the memory address pointing to the previous node (also known as the previous node address), and bytes 4 to 7 store the memory address pointing to the next node (and Known as the next node address), the 8th to 11th bytes store the main page number, and the 12th to 15th bytes store the corresponding physical location information. The address of the previous node can store a false value (NULL value, such as 0xFFFFFFFF) to indicate that this node is the first node in the chain, and the address of the next node can store a false value to indicate that this node is the chain The last node of the column. For example, nodes 300 and 390 are the first and last nodes of the chain. The starting address of node 300 is 0x00000000, the starting address of node 310 is 0x00000010, and so on. The next node address of node 300 points to the memory address 0x00000010 (that is, the starting address of node 310), and the next node address of node 310 points to the memory address 0x00000020 (that is, the starting address of node 320), So on and so forth. The previous node address of node 390 points to the memory address 0x00000080 (that is, the starting address of node 380), and the previous node address of node 380 points to the memory address 0x00000070 (that is, the starting address of node 370), So on and so forth. The main page label stored by node 300 is 0x00000033 and the corresponding physical location information is variable PA0, the main page label stored by node 310 is 0x00000044 and the corresponding physical location information is variable PA1, and so on, the values of variables PA0 to PA9 are processed by Fill in unit 110. Although the embodiments of the present invention arrange the nodes 200 and 290 of the link series 131 according to the sequential order of the addresses of the memory 130 to facilitate reading, but after several insertions and deletions, the order of the nodes 300 and 390 is usually Does not match the address order of the memory 130.

圖5至7為依據本發明實施例的鏈結串列搜索引擎的方塊圖,用以實現如圖2所述的鏈結串列搜索方法。5 to 7 are block diagrams of a link tandem search engine according to an embodiment of the present invention, for implementing the link tandem search method described in FIG. 2.

參考圖5。鏈結串列搜索引擎500可包含配置寄存器170、讀取電路(reading circuit)520、FIFO緩衝區(FIFO buffer)530、比較器540、寫入電路(writing circuits)550及560、以及結果寄存器(result register)590。處理單元110可設定配置寄存器170,用以儲存第一個節點的起始位址、每個節點的資料結構資訊(例如,前一節點位址的偏移量(offset)、下一節點位址的偏移量、比較資料的偏移量及對應結果的偏移量等),搜索值及搜索方向。當處理單元110致能鏈結串列搜索引擎500時,讀取電路520可依據配置寄存器170的內容從鏈結串列131讀取第一個節點的下或前一節點位址、比較資料及對應結果,並輸出比較資料及對應結果至FIFO緩衝區530。此外,讀取電路520可將第一個節點的起始位址輸出至FIFO緩衝區530。比較器540比較配置寄存器170的搜索值及FIFO緩衝區530的比較資料,當二者不同時,輸出致能訊號EN1給讀取電路520,用以驅動讀取電路520從鏈結串列131讀取下一節點的內容。讀取電路520可判斷是否還有任何節點尚未處理,例如,下或前一節點位址是否不是虛假值。如果是,讀取電路520可依據配置寄存器170的內容及下或前一節點位址從鏈結串列131讀取下或前一個節點的如上所述內容,以及將如上所述的內容的一部份輸出至FIFO緩衝區530。如果不是,讀取電路520輸出致能訊號EN3給寫入電路560,驅動寫入電路560儲存搜索失敗的資訊至結果寄存器590。當比較器540判斷配置寄存器170的搜索值與FIFO緩衝區530的比較資料相同時,輸出致能訊號EN2給寫入電路550,驅動寫入電路550儲存FIFO緩衝區530的對應結果及目前搜索節點的起始位址,以及搜索成功的資訊至結果寄存器590。例如,結果寄存器590的第0至3位元組儲存搜索到的對應結果,第4至7位元組儲存目前搜索節點的起始位址,及第8位元組儲存搜索成功或失敗的資訊。當搜索成功時,第8位元組可設為1;反之,設為0。Refer to Figure 5. The link tandem search engine 500 may include a configuration register 170, a reading circuit 520, a FIFO buffer 530, a comparator 540, writing circuits 550 and 560, and a result register ( result register) 590. The processing unit 110 can set a configuration register 170 to store the starting address of the first node, the data structure information of each node (for example, the offset of the previous node address, the address of the next node) Offset, comparison data offset and corresponding result offset, etc.), search value and search direction. When the processing unit 110 enables the link serial search engine 500, the reading circuit 520 can read the address of the first node under the previous node, the comparison data and the link node 131 according to the content of the configuration register 170 Corresponding results, and output the comparison data and corresponding results to the FIFO buffer 530. In addition, the reading circuit 520 may output the start address of the first node to the FIFO buffer 530. The comparator 540 compares the search value of the configuration register 170 with the comparison data of the FIFO buffer 530. When the two are different, the enable signal EN1 is output to the reading circuit 520 to drive the reading circuit 520 to read from the link serial 131 Take the content of the next node. The reading circuit 520 can determine whether any nodes have not yet been processed, for example, whether the address of the next or previous node is not a false value. If so, the reading circuit 520 can read the above-mentioned content of the next or previous node from the link serial 131 according to the content of the configuration register 170 and the address of the next or previous node, and Part output to FIFO buffer 530. If not, the reading circuit 520 outputs the enable signal EN3 to the writing circuit 560, and the writing circuit 560 is driven to store the information about the search failure to the result register 590. When the comparator 540 determines that the search value of the configuration register 170 is the same as the comparison data of the FIFO buffer 530, it outputs an enable signal EN2 to the write circuit 550, and drives the write circuit 550 to store the corresponding result of the FIFO buffer 530 and the current search node The starting address of, and the successful search information to the result register 590. For example, the 0th to 3rd bytes of the result register 590 store the corresponding results of the search, the 4th to 7th bytes store the starting address of the current search node, and the 8th byte stores the information about the success or failure of the search . When the search is successful, the 8th byte can be set to 1; otherwise, it is set to 0.

為了讓處理單元110最佳化鏈結串列131中節點的擺放順序,於一些實施例,鏈結串列搜索引擎500可包含計數器580,耦接比較器540及寫入電路550,於每次搜索作業開始時初始為0。每次比較配置寄存器170的搜索值及FIFO緩衝區530的比較資料時,比較器540將計數器580累加1。當比較器540判斷配置寄存器170的搜索值及FIFO緩衝區530的比較資料相同時,驅動寫入電路550儲存計數器580的值至結果寄存器590。例如,結果寄存器590的第9位元組儲存計數器的值。In order to allow the processing unit 110 to optimize the order of the nodes in the link string 131, in some embodiments, the link string search engine 500 may include a counter 580, coupled to the comparator 540 and the write circuit 550, each time The initial search job starts at 0. Each time the search value of the configuration register 170 and the comparison data of the FIFO buffer 530 are compared, the comparator 540 increments the counter 580 by one. When the comparator 540 determines that the search value of the configuration register 170 and the comparison data of the FIFO buffer 530 are the same, the drive write circuit 550 stores the value of the counter 580 to the result register 590. For example, the 9th byte of the result register 590 stores the value of the counter.

每個節點的比較資料可包含複合資料(compound data),例如,包含二種以上不同類型的資料。於一些實施例,處理單元110可設定配置寄存器170,以使用4個位元組儲存遮罩(mask)。比較器540可將FIFO緩衝區530的比較資料與配置寄存器170的遮罩進行邏輯及運算(logic AND)以產生遮罩後比較資料,接著判斷配置寄存器170的搜索值及遮罩後比較資料是否相同。如果是,比較器540驅動寫入電路550儲存FIFO緩衝區530的對應結果及目前搜索節點的起始位址,以及搜索成功的資訊至結果寄存器590。例如,如圖3所示的主頁面編號的前二位元組為T1表的編號,而後二位元組為T7表的編號。當配置寄存器170的搜索值為T1表的編號時,處理單元110可儲存遮罩0xFFFF00000至配置寄存器170,使得比較器540可忽略主頁面編號的後二位元組(也就是T7表的編號)。當配置寄存器170的搜索值為T7表的編號時,處理單元110可儲存遮罩0x0000FFFF至配置寄存器170,使得比較器540可忽略主頁面編號的前二位元組(也就是T1表的編號)。The comparison data of each node may include compound data, for example, two or more different types of data. In some embodiments, the processing unit 110 may set a configuration register 170 to use 4 bytes to store a mask. The comparator 540 can perform a logical AND operation on the comparison data of the FIFO buffer 530 and the mask of the configuration register 170 to generate the comparison data after masking, and then determine whether the search value of the configuration register 170 and the comparison data after masking the same. If it is, the comparator 540 drives the writing circuit 550 to store the corresponding result of the FIFO buffer 530 and the starting address of the current search node, and the information of the successful search to the result register 590. For example, as shown in FIG. 3, the first two bytes of the main page number are the numbers of the T1 table, and the last two bytes are the numbers of the T7 table. When the search value of the configuration register 170 is the number of the T1 table, the processing unit 110 can store the mask 0xFFFF00000 to the configuration register 170, so that the comparator 540 can ignore the last two bytes of the main page number (that is, the number of the T7 table) . When the search value of the configuration register 170 is the number of the T7 table, the processing unit 110 can store the mask 0x0000FFFF to the configuration register 170, so that the comparator 540 can ignore the first two bytes of the main page number (that is, the number of the T1 table) .

每個節點的比較資料可包含不需要比較的位元,例如,最高有效位(Most Significant Bit)。於一些實施例,處理單元110可設定配置寄存器170,用以使用1個位元組儲存忽略位元的資訊,例如,0x1F代表比較資料的第31位元可忽略。比較器540可依據忽略位元的資訊產生遮罩,將FIFO緩衝區530的比較資料與此遮罩進行邏輯及運算,接著判斷配置寄存器170的搜索值及遮罩後比較資料是否相同。如果是,比較器540驅動寫入電路550儲存FIFO緩衝區530的對應結果及目前搜索節點的起始位址,以及搜索成功的資訊至結果寄存器590。例如,當忽略位元為第31位元時,遮罩為0x7FFFFFFF。The comparison data of each node may contain bits that do not need to be compared, for example, the most significant bit (Most Significant Bit). In some embodiments, the processing unit 110 may set a configuration register 170 to use 1 byte to store the information of the ignored bits. For example, 0x1F represents that the 31st bit of the comparison data can be ignored. The comparator 540 can generate a mask based on the information of the ignored bits, perform a logical AND operation on the comparison data of the FIFO buffer 530 and the mask, and then determine whether the search value of the configuration register 170 and the comparison data after the mask are the same. If it is, the comparator 540 drives the writing circuit 550 to store the corresponding result of the FIFO buffer 530 and the starting address of the current search node, and the information of the successful search to the result register 590. For example, when the ignore bit is the 31st bit, the mask is 0x7FFFFFFF.

參考圖3的鏈結串列131。假設配置寄存器170的第0至3位元組儲存第一個節點的起始位址為0x00000000,第4至7位元組儲存搜索值0x00000077,第8位元組儲存搜索方向為向前搜索,第9至12位元組分別儲存每個節點的前一節點位址的偏移量為0x00、下一位址節點的偏移量為0x04、資料的偏移量0x08及對應結果的偏移量為0x0C,其中的偏移量以位元組為單位。當處理單元110致能鏈結串列搜索引擎500後,比較器540於節點340發現搜索值0x00000077,驅動寫入電路550儲存FIFO緩衝區530的對應結果[PA4] 、節點340的起始位址0x40、以及搜索成功的資訊至結果寄存器590。此外,比較器540可更趨動寫入電路550儲存計數器的值(也就是5)至結果寄存器590。Refer to the link series 131 of FIG. 3. Suppose that the 0th to 3rd bytes of the configuration register 170 store the starting address of the first node as 0x00000000, the 4th to 7th bytes store the search value 0x00000077, and the 8th byte store the search direction as forward search, The 9th to 12th bytes respectively store the offset of the previous node address of each node as 0x00, the offset of the next bit node as 0x04, the offset of the data as 0x08 and the offset of the corresponding result It is 0x0C, and the offset is in bytes. After the processing unit 110 enables the chain search engine 500, the comparator 540 finds the search value 0x00000077 at the node 340, and drives the write circuit 550 to store the corresponding result of the FIFO buffer 530 [PA4], the starting address of the node 340 0x40, and the successful search information to the result register 590. In addition, the comparator 540 may further trigger the write circuit 550 to store the counter value (that is, 5) to the result register 590.

參考圖6。由於韌體可能有二組以上常用的配置設定,鏈結串列搜索引擎600可更包含捷徑寄存器610_1及610_2,用以讓處理單元110預先分別儲存二組配置設定至捷徑寄存器610_1及610_2,其中每組配置設定可包含鏈結串列131的一起始節點的記憶體位址、搜索值以及每一該節點的資料結構資訊。每組配置設定可更包含如上所述的遮罩或忽略位元的資訊。鏈結串列搜索引擎600另包含多工器(multiplexer)630,其輸入端耦接至捷徑寄存器610_1及610_2的輸出,其輸出端耦接至配置寄存器170的輸入。處理單元110可輸出選擇訊號SE給多工器630,用以將捷徑寄存器610_1及610_2中之一者耦接至配置寄存器170,使得配置寄存器170可儲存耦接捷徑寄存器中的配置設定。雖然圖6的實施例只包含二個捷徑寄存器,所屬技術領域具有通常知識者可修改鏈結串列搜索引擎600,用以包含更多的捷徑寄存器,本發明並不因此受限。圖6中其他元件的結構、功能及作業細節可參考圖5的描述,為求簡潔不再贅述。Refer to Figure 6. Since the firmware may have more than two commonly used configuration settings, the link tandem search engine 600 may further include shortcut registers 610_1 and 610_2 to allow the processing unit 110 to store two sets of configuration settings in the shortcut registers 610_1 and 610_2, respectively, in which Each set of configuration settings may include the memory address, search value, and data structure information of each starting node of the link series 131. Each set of configuration settings may further include information about masking or ignoring bits as described above. The link tandem search engine 600 further includes a multiplexer 630 whose input is coupled to the outputs of the shortcut registers 610_1 and 610_2, and whose output is coupled to the input of the configuration register 170. The processing unit 110 may output the selection signal SE to the multiplexer 630 to couple one of the shortcut registers 610_1 and 610_2 to the configuration register 170 so that the configuration register 170 can store the configuration settings in the coupled shortcut register. Although the embodiment of FIG. 6 includes only two shortcut registers, those skilled in the art can modify the link tandem search engine 600 to include more shortcut registers, and the present invention is not limited thereby. The structure, function and operation details of other elements in FIG. 6 can refer to the description of FIG. 5, and will not be repeated for brevity.

參考圖7。為了讓並行作業更有效率,鏈結串列搜索引擎700可提供多筆搜索的能力,讓處理單元110一次提供多個搜索值後便可轉去處理其他的任務,有利處理單元110安排鏈結串列131的搜索及其他任務,最佳化系統的整體效能。處理單元110可於記憶體130分配一塊固定區域,用以儲存多筆搜索紀錄710,以及讓鏈結串列搜索引擎700寫入結果紀錄790。每筆搜索紀錄包含開始旗標及搜索值,開始旗標用以通知鏈結串列搜索引擎700是否可以開始搜索鏈結串列131。每筆結果紀錄790關聯於一筆搜索紀錄710,包含結束旗標、結果旗標、搜索次數以及搜索到節點的記憶體位址,結束旗標及結果旗標用以分別通知處理單元110此搜索值的搜索是否已結束以及是否已搜索到。搜索紀錄710及結果紀錄790可整合在一起,便於存取。Refer to Figure 7. In order to make parallel operations more efficient, the link tandem search engine 700 can provide multiple search capabilities, allowing the processing unit 110 to provide multiple search values at a time and then transfer to other tasks, which is advantageous for the processing unit 110 to arrange links Serial 131 searches and other tasks optimize the overall performance of the system. The processing unit 110 may allocate a fixed area in the memory 130 for storing multiple search records 710 and for the link serial search engine 700 to write the result records 790. Each search record includes a start flag and a search value. The start flag is used to notify the link list search engine 700 whether it can start searching the link list 131. Each result record 790 is associated with a search record 710, including the end flag, the result flag, the number of searches, and the memory address of the searched node. The end flag and the result flag are used to notify the processing unit 110 of the search value. Whether the search has ended and whether it has been searched. The search record 710 and the result record 790 can be integrated together for easy access.

讀取電路720可檢查是否存在一筆開始旗標為1(代表可以開始搜索)且結束旗標為0(代表尚未搜索結束)的紀錄。一旦發現符合條件的紀錄,讀取電路720將此紀錄的搜索值儲存至配置寄存器170。讀取電路520的作業可參考圖5的相關說明,為求簡潔不再贅述。當讀取電路520發現沒有任何節點可以搜索時,輸出致能訊號EN3給寫入電路730,驅動寫入電路730儲存搜索值及搜索失敗的資訊至FIFO緩衝區750。寫入電路730可更儲存鏈結串列131的節點數目至FIFO緩衝區750,作為搜索次數。當比較器740判斷配置寄存器170的搜索值及FIFO緩衝區530的比較資料相同時,將FIFO緩衝區530的對應結果、目前節點的起始位址,及搜索成功的資訊儲存至FIFO緩衝區750。比較器740可更包含計數器,於搜索開始前初始為0。每次比較配置寄存器170的搜索值與FIFO緩衝區530的比較資料時,計數器累加1。當比較器740判斷配置寄存器170的搜索值及FIFO緩衝區530的比較資料相同時,更儲存計數器的值至FIFO緩衝區750,作為搜索次數。當資料進入FIFO緩衝區750時,寫入電路760將FIFO緩衝區750的內容寫入結果紀錄790,並且輸出致能訊號EN4至讀取電路720,用以讀取下一筆搜索紀錄710。The reading circuit 720 can check whether there is a record with a start flag of 1 (indicating that the search can be started) and an end flag of 0 (indicating that the search has not ended). Once a qualified record is found, the reading circuit 720 stores the search value of the record in the configuration register 170. For the operation of the reading circuit 520, reference may be made to the relevant description in FIG. When the reading circuit 520 finds that no node can be searched, it outputs the enable signal EN3 to the writing circuit 730, and drives the writing circuit 730 to store the search value and the information of the search failure to the FIFO buffer 750. The write circuit 730 can further store the number of nodes of the link series 131 in the FIFO buffer 750 as the number of searches. When the comparator 740 determines that the search value of the configuration register 170 and the comparison data of the FIFO buffer 530 are the same, the corresponding result of the FIFO buffer 530, the starting address of the current node, and the information of the successful search are stored in the FIFO buffer 750 . The comparator 740 may further include a counter, which is initially 0 before the search starts. Each time the search value of the configuration register 170 is compared with the comparison data of the FIFO buffer 530, the counter is incremented by one. When the comparator 740 determines that the search value of the configuration register 170 and the comparison data of the FIFO buffer 530 are the same, it further stores the value of the counter in the FIFO buffer 750 as the number of searches. When the data enters the FIFO buffer 750, the writing circuit 760 writes the content of the FIFO buffer 750 to the result record 790, and outputs an enable signal EN4 to the reading circuit 720 for reading the next search record 710.

以下搭配圖3的鏈結串列131,舉幾個實例說明鏈結串列搜索引擎700的運作。搜索紀錄710及結果紀錄790可整合成一張表,初始如表1所示: 表1

Figure 107123751-A0304-0001
每筆記錄可使用13個位元組儲存資料,其中,1個位元組紀錄開始旗標Start[4](第4位元)及結束旗標Done[0] (第0位元),4個位元組紀錄搜索值Pattern[31:0](所有位元),4個位元組紀錄結果旗標Result[31](第31位元)及搜索次數Effort[30:0] (第0至30位元),4個位元組紀錄搜索到節點的記憶體位址Address[31:0](所有位元)。開始旗標可視為致能鏈結串列搜索引擎700的訊號。初始時,處理單元110寫入四個搜索值0x000000AA、0x00000044、0x00000052及0x00000055,並將前二個搜索值的開始旗標設為1。In the following, with the link chain 131 of FIG. 3, a few examples are given to illustrate the operation of the link chain search engine 700. Search record 710 and result record 790 can be integrated into a table, the initial as shown in Table 1: Table 1
Figure 107123751-A0304-0001
Each record can use 13 bytes to store data, including 1 byte record start flag Start[4] (4th bit) and end flag Done[0] (0th bit), 4 Byte record search value Pattern[31:0] (all bytes), 4-byte record result flag Result[31] (31st byte) and search frequency Effort[30:0] (0th To 30 bytes), 4 bytes record to find the memory address of the node Address[31:0] (all bytes). The start flag may be regarded as a signal enabling the search engine 700 to be linked. Initially, the processing unit 110 writes four search values 0x000000AA, 0x00000044, 0x00000052, and 0x00000055, and sets the start flag of the first two search values to 1.

接著,鏈結串列搜索引擎700於鏈結串列131的節點370搜索到值0x000000AA,更新結果如表2所示: 表2

Figure 107123751-A0304-0002
寫入電路760在第一筆紀錄中將結束旗標Done[0]設為1,將結果旗標Result[31]設為1,將搜索次數Effort[30:0]設為8,將搜索到節點的記憶體位址Address[31:0]設為0x00000070。Next, the link list search engine 700 searches the node 370 of the link list 131 for the value 0x000000AA, and the update result is shown in Table 2: Table 2
Figure 107123751-A0304-0002
The writing circuit 760 sets the end flag Done[0] to 1 in the first record, sets the result flag Result[31] to 1, sets the number of search Effort[30:0] to 8, and searches for The memory address Address[31:0] of the node is set to 0x00000070.

接著,處理單元110更加上二個搜索值0x00000066及0x00000067,並且將其餘的所有開始旗標設為1,更新結果如表3所示: 表3

Figure 107123751-A0304-0003
Next, the processing unit 110 adds the two search values 0x00000066 and 0x00000067, and sets all the remaining start flags to 1, and the update results are shown in Table 3: Table 3
Figure 107123751-A0304-0003

接著,鏈結串列搜索引擎700於鏈結串列131的節點310搜索到值0x00000044,但搜索不到值0x00000052。然後,鏈結串列搜索引擎700於鏈結串列131的節點320搜索到值0x00000055。以上結果更新如表4所示: 表4

Figure 107123751-A0304-0004
Next, the link list search engine 700 searches the node 310 of the link list 131 for the value 0x00000044, but the value 0x00000052 is not found. Then, the link list search engine 700 searches the node 320 of the link list 131 for the value 0x00000055. The above results are updated as shown in Table 4: Table 4
Figure 107123751-A0304-0004

所屬技術領域具有通常知識者可將圖5至圖7的鏈結串列搜索引擎500至700結合成一個鏈結串列搜索引擎,並且除了寄存器以外的每個元件都共享一個模式訊號。處理單元110透過模式訊號可將鏈結串列搜索引擎配置成如圖5至圖7中之一者。Those of ordinary skill in the art can combine the link serial search engines 500 to 700 of FIGS. 5 to 7 into a link serial search engine, and each element except the register shares a mode signal. The processing unit 110 can configure the link tandem search engine to be one of those shown in FIGS. 5 to 7 through the mode signal.

雖然圖1、5~7中包含了以上描述的元件,但不排除在不違反發明的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然圖2的流程圖採用指定的順序來執行,但是在不違反發明精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所以,本發明並不侷限於僅使用如上所述的順序。此外,熟習此技藝人士亦可以將若干步驟整合為一個步驟,或者是除了這些步驟外,循序或平行地執行更多步驟,本發明亦不因此而侷限。Although the elements described above are included in FIGS. 1, 5-7, it does not exclude the use of more other additional elements without violating the spirit of the invention, and a better technical effect has been achieved. In addition, although the flowchart in FIG. 2 is executed in a specified order, without violating the spirit of the invention, a person skilled in the art can modify the order between these steps on the premise of achieving the same effect. Therefore, the present invention does not It is not limited to use only the order described above. In addition, those skilled in the art can also integrate several steps into one step, or in addition to these steps, perform more steps sequentially or in parallel, and the present invention is not limited thereby.

雖然本發明使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本發明。相反地,此發明涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。Although the present invention is described using the above embodiments, it should be noted that these descriptions are not intended to limit the present invention. On the contrary, this invention covers obvious modifications and similar settings for those skilled in the art. Therefore, the scope of the claims of the application must be interpreted in the broadest way to include all obvious modifications and similar settings.

110‧‧‧處理單元110‧‧‧Processing unit

130‧‧‧記憶體130‧‧‧Memory

131‧‧‧鏈結串列131‧‧‧Chain

150‧‧‧鏈結串列搜索引擎150‧‧‧Linked Search Engine

170‧‧‧配置寄存器170‧‧‧Configuration register

S210~S270‧‧‧方法步驟S210~S270‧‧‧Method steps

300~390‧‧‧節點300~390‧‧‧node

410‧‧‧實體儲存對照表410‧‧‧ physical storage comparison table

430‧‧‧實體位置資訊430‧‧‧Physical location information

430-0‧‧‧實體區塊編號430-0‧‧‧Entity block number

430-1‧‧‧主頁面的起始單元編號430-1‧‧‧ The starting unit number of the main page

450‧‧‧實體區塊450‧‧‧ physical block

451‧‧‧主頁面451‧‧‧Main page

500、600、700‧‧‧鏈結串列搜索引擎500, 600, 700 ‧‧‧ link search engine

520、720‧‧‧讀取電路520, 720‧‧‧ reading circuit

530、750‧‧‧FIFO緩衝區530, 750‧‧‧ FIFO buffer

540、740‧‧‧比較器540、740‧‧‧Comparator

550、560、730、760‧‧‧寫入電路550, 560, 730, 760‧‧‧ writing circuit

590‧‧‧結果寄存器590‧‧‧Result register

610_1、610_2‧‧‧捷徑寄存器610_1, 610_2 ‧‧‧ shortcut register

630‧‧‧多工器630‧‧‧Multiplexer

710‧‧‧搜索紀錄710‧‧‧ search record

790‧‧‧結果紀錄790‧‧‧Result record

EN1~EN4‧‧‧致能訊號EN1~EN4‧Enable signal

SE‧‧‧選擇訊號SE‧‧‧Select signal

圖1為依據本發明實施例的鏈結串列搜索裝置方塊圖。FIG. 1 is a block diagram of a link serial search device according to an embodiment of the invention.

圖2為依據本發明實施例的鏈結串列搜索的方法流程圖。FIG. 2 is a flowchart of a method of link tandem search according to an embodiment of the present invention.

圖3為依據本發明實施例的鏈結串列示意圖。FIG. 3 is a schematic diagram of a chain of links according to an embodiment of the invention.

圖4為依據本發明實施例的實體儲存對照示意圖。FIG. 4 is a schematic diagram of physical storage comparison according to an embodiment of the invention.

圖5至7為依據本發明實施例的鏈結串列搜索引擎的方塊圖。5 to 7 are block diagrams of a chained search engine according to an embodiment of the present invention.

110‧‧‧處理單元 110‧‧‧Processing unit

130‧‧‧記憶體 130‧‧‧Memory

131‧‧‧鏈結串列 131‧‧‧Chain

150‧‧‧鏈結串列搜索引擎 150‧‧‧Linked Search Engine

170‧‧‧配置寄存器 170‧‧‧Configuration register

Claims (20)

一種鏈結串列搜索裝置,包含: 一記憶體,儲存一鏈結串列; 一鏈結串列搜索引擎,耦接於該記憶體,用以搜索該鏈結串列的內容直到搜索成功或搜索失敗為止,及產生一搜索結果;以及 一處理單元,耦接於該記憶體及該鏈結串列搜索引擎,用以寫入該鏈結串列的內容至該記憶體,驅動該鏈結串列搜索引擎開始該鏈結串列的搜索作業,並且從該鏈結串列搜索引擎取得該搜索結果。A link tandem search device includes: a memory storing a link tandem; a link tandem search engine, coupled to the memory, for searching the contents of the link tandem until the search is successful or Until the search fails, and a search result is generated; and a processing unit, coupled to the memory and the link serial search engine, is used to write the contents of the link serial to the memory to drive the link The tandem search engine starts the search operation of the link tandem, and obtains the search result from the link tandem search engine. 如請求項1所述的鏈結串列搜索裝置,包含: 一配置寄存器,耦接於該處理單元及該鏈結串列搜索引擎; 其中,該鏈結串列包含多個節點,每一該節點包含一下或前一節點位址、一比較資料及一對應結果, 其中,該處理單元設定該配置寄存器,用以儲存該鏈結串列的一起始節點的記憶體位址、一搜索值以及每一該節點的資料結構資訊, 其中,該鏈結串列搜索引擎根據該配置寄存器的內容搜索該鏈結串列。The link serial search device according to claim 1, comprising: a configuration register coupled to the processing unit and the link serial search engine; wherein, the link serial includes a plurality of nodes, each of which The node contains the next or previous node address, a comparison data and a corresponding result, wherein the processing unit sets the configuration register to store the memory address of a starting node of the link series, a search value and each A data structure information of the node, wherein the link serial search engine searches the link serial according to the content of the configuration register. 如請求項2所述的鏈結串列搜索裝置,其中,每一該節點的資料結構資訊包含該下或前一節點位址的偏移量、該比較資料的偏移量及該對應結果的偏移量。The link serial search device according to claim 2, wherein the data structure information of each of the nodes includes the offset of the next or previous node address, the offset of the comparison data, and the corresponding result Offset. 如請求項1所述的鏈結串列搜索裝置,其中,該鏈結串列包含多個節點,每一該節點包含一下或前一節點位址、一比較資料及一對應結果,該比較資料包含一實體儲存對照表的一主頁面編號,以及該對應結果包含該實體儲存對照表的一實體位置。The link serial search device according to claim 1, wherein the link serial includes a plurality of nodes, and each of the nodes includes the next or previous node address, a comparison data, and a corresponding result, the comparison data Contains a main page number of a physical storage comparison table, and the corresponding result includes a physical location of the physical storage comparison table. 如請求項1所述的鏈結串列搜索裝置,其中,該鏈結串列搜索引擎搜索該鏈結串列內容的期間,該處理單元並行地執行一任務。The link tandem search device according to claim 1, wherein the processing unit executes a task in parallel while the link tandem search engine searches the link tandem content. 如請求項1所述的鏈結串列搜索裝置,其中,該鏈結串列包含多個節點,以及該鏈結串列搜索引擎包含: 一第一寫入電路; 一第二寫入電路; 一配置寄存器,其中該處理單元設定該配置寄存器,用以儲存該鏈結串列的一起始節點的記憶體位址、一搜索值以及每一該節點的資料結構資訊; 一第一讀取電路,耦接該配置寄存器及該第一寫入電路,用以根據該配置寄存器的內容依序讀取該連結串列中的該節點,並且當讀取不到該鏈結串列的任何節點時,驅動該第一寫入電路用以儲存搜索失敗的資訊,使得該處理單元取得該搜索失敗的資訊;以及 一比較器,耦接該配置寄存器、該讀取電路及該第二寫入電路,用以當判斷該配置寄存器的該搜索值與的該節點中之一者的一比較資料相同時,驅動該第二寫入電路用以儲存該搜索到節點的一起始位址及一對應結果,以及搜索成功的資訊,使得該處理單元取得該搜索到節點的該起始位址及該對應結果,以及該搜索成功的資訊。The link tandem search device according to claim 1, wherein the link tandem includes a plurality of nodes, and the link tandem search engine includes: a first write circuit; a second write circuit; A configuration register, wherein the processing unit sets the configuration register to store the memory address, a search value, and the data structure information of each node of the starting node of the link series; a first reading circuit, Coupled to the configuration register and the first writing circuit, for sequentially reading the node in the link series according to the content of the configuration register, and when no node in the link series can be read, Driving the first writing circuit to store information about the search failure, so that the processing unit obtains the information about the search failure; and a comparator, coupled to the configuration register, the reading circuit, and the second writing circuit, for When it is determined that the search value of the configuration register is the same as a comparison data of one of the nodes, the second write circuit is driven to store a starting address and a corresponding result of the searched node, and The successful search information enables the processing unit to obtain the starting address and the corresponding result of the searched node, and the successful search information. 如請求項6所述的鏈結串列搜索裝置,其中,當該比較器判斷該配置寄存器的該搜索值與的該節點中之一者的該比較資料不同時,驅動該第一讀取電路讀取該連結串列中的下或前一節點。The link tandem search device according to claim 6, wherein, when the comparator determines that the search value of the configuration register is different from the comparison data of one of the nodes, the first reading circuit is driven Read the next or previous node in the link list. 如請求項6所述的鏈結串列搜索裝置,其中,該鏈結串列搜索引擎包含: 一計數器,耦接該比較器及該第二寫入電路,於每次搜索作業開始時初始為0, 其中,每次比較該配置寄存器的該搜索值及該節點中之一者的該比較資料時,該比較器將該計數器累加1,以及當判斷該配置寄存器的該搜索值與的該節點中之一者的一比較資料相同時,該比較器驅動該第二寫入電路儲存該計數器的值,使得該處理單元取得該計數器的值。The link tandem search device according to claim 6, wherein the link tandem search engine includes: a counter, coupled to the comparator and the second writing circuit, initially at the beginning of each search operation is 0, wherein each time the search value of the configuration register and the comparison data of one of the nodes are compared, the comparator increments the counter by 1, and when the search value of the configuration register is judged and the node When one of the comparison data is the same, the comparator drives the second writing circuit to store the value of the counter, so that the processing unit obtains the value of the counter. 如請求項6所述的鏈結串列搜索裝置,其中,該處理單元設定該配置寄存器,用以儲存一遮罩,其中該比較器將每一該節點的該比較資料與該遮罩進行一邏輯及運算以產生一遮罩後比較資料,當判斷該遮罩後比較資料與該搜索值相同時,驅動該第二寫入電路用以儲存該搜索到節點的該起始位址及該對應結果,以及該搜索成功的資訊。The link serial search device according to claim 6, wherein the processing unit sets the configuration register to store a mask, and the comparator compares the comparison data of each node with the mask Logic and operation to generate a post-mask comparison data, when it is determined that the post-mask comparison data is the same as the search value, the second write circuit is driven to store the starting address and the correspondence of the searched node Results, and information about the success of the search. 如請求項6所述的鏈結串列搜索裝置,其中,該處理單元設定該配置寄存器,用以儲存忽略位元的資訊,其中該比較器依據該忽略位元的資訊產生一遮罩,將每一該節點的該比較資料與該遮罩進行一邏輯及運算以產生一遮罩後比較資料,當判斷該遮罩後比較資料與該搜索值相同時,驅動該第二寫入電路用以儲存該搜索到節點的該起始位址及該對應結果,以及該搜索成功的資訊。The link serial search device according to claim 6, wherein the processing unit sets the configuration register to store information of ignored bits, wherein the comparator generates a mask based on the information of ignored bits The comparison data of each node and the mask perform a logical AND operation to generate a post-mask comparison data. When it is determined that the post-mask comparison data is the same as the search value, the second writing circuit is driven to The starting address and the corresponding result of the searched node are stored, as well as information on the successful search. 如請求項6所述的鏈結串列搜索裝置,其中,該第一寫入電路儲存該搜索到節點的該起始位址及該對應結果,以及該搜索成功的資訊至一結果寄存器。The link tandem search device according to claim 6, wherein the first writing circuit stores the starting address and the corresponding result of the searched node, and information on the successful search to a result register. 如請求項6所述的鏈結串列搜索裝置,其中,該鏈結串列搜索引擎包含: 一第一捷徑寄存器,儲存一第一組配置設定; 一第二捷徑寄存器,儲存一第二組配置設定;以及 一多工器,耦接該第一捷徑寄存器、該第二捷徑寄存器及該配置寄存器, 其中,該處理器輸出選擇訊號給該多工器,用以將該第一捷徑寄存器及該第二捷徑寄存器中之一者耦接至該配置寄存器,使得該配置寄存器儲存該耦接捷徑寄存器中的該組配置設定。The link tandem search device according to claim 6, wherein the link tandem search engine includes: a first shortcut register to store a first set of configuration settings; a second shortcut register to store a second set Configuration settings; and a multiplexer coupled to the first shortcut register, the second shortcut register and the configuration register, wherein the processor outputs a selection signal to the multiplexer to use the first shortcut register and One of the second shortcut registers is coupled to the configuration register so that the configuration register stores the set of configuration settings in the coupled shortcut register. 如請求項6所述的鏈結串列搜索裝置,其中,該記憶體儲存多筆搜索紀錄,以及該鏈結串列搜索引擎包含: 一第二讀取電路,耦接該配置寄存器,用以讀取該搜索紀錄中指出可以開始搜索但尚未搜索結束的搜索值,儲存該指出搜索值至該配置寄存器。The link serial search device according to claim 6, wherein the memory stores multiple search records, and the link serial search engine includes: a second reading circuit coupled to the configuration register for Read the search value indicating that the search can be started but not yet ended in the search record, and store the indicated search value in the configuration register. 如請求項13所述的鏈結串列搜索裝置,其中,該處理單元提供該搜索紀錄中的該搜索值。The link tandem search device according to claim 13, wherein the processing unit provides the search value in the search record. 如請求項13所述的鏈結串列搜索裝置,其中,該第一寫入電路儲存該搜索到節點的該起始位址及該對應結果,以及該搜索成功的資訊至該記憶體中相應於該指出搜索值的一結果紀錄。The link tandem search device according to claim 13, wherein the first writing circuit stores the starting address and the corresponding result of the searched node, and the information of the successful search to the corresponding memory It is a record of the results indicating the search value. 一種鏈結串列搜索方法,由一鏈結串列搜索引擎執行,包含: 從一配置寄存器取得由一處理單元設定的一鏈結串列的一起始節點的記憶體位址,以及一搜索值; 反覆執行一迴圈,用以從該起始節點開始依序取得並處理該鏈結串列中的多個節點,直到搜索成功或搜索失敗為止; 當搜索成功時,儲存一搜索結果及搜索成功的資訊,使得該處理單元取得該搜索結果及該搜索成功的資訊;以及 當搜索失敗時,儲存搜索失敗的資訊,使得該處理單元取得該搜索失敗的資訊。A link tandem search method, executed by a link tandem search engine, includes: obtaining the memory address of a starting node of a link tandem set by a processing unit from a configuration register, and a search value; Repeatedly execute a loop to sequentially acquire and process multiple nodes in the link sequence from the starting node until the search is successful or the search fails; when the search is successful, store a search result and the search is successful Information, so that the processing unit obtains the search result and the information of the successful search; and when the search fails, the information of the failed search is stored, so that the processing unit obtains the information of the failed search. 如請求項16所述的鏈結串列搜索方法,其中,該鏈結串列搜索引擎搜索該鏈結串列內容的期間,該處理單元並行地執行一任務。The link tandem search method according to claim 16, wherein the processing unit executes a task in parallel while the link tandem search engine searches the link tandem content. 如請求項16所述的鏈結串列搜索方法,其中,該鏈結串列包含多個節點,每一該節點包含一下或前一節點位址、一比較資料及一對應結果。The method for searching a chain link according to claim 16, wherein the chain link includes a plurality of nodes, and each of the nodes includes the address of the next or previous node, a comparison data, and a corresponding result. 如請求項18所述的鏈結串列搜索方法,其中,該比較資料包含一實體儲存對照表的一主頁面編號,以及該對應結果包含該實體儲存對照表的一實體位置。The link tandem search method according to claim 18, wherein the comparison data includes a main page number of an entity storage comparison table, and the corresponding result includes an entity location of the entity storage comparison table. 如請求項16所述的鏈結串列搜索方法,其中,該鏈結串列包含多個節點,該配置寄存器儲存每一該節點的資料結構資訊,並且該鏈結串列中的每一該節點的內容的取得是依據該資料結構資訊。The link serial search method according to claim 16, wherein the link serial includes a plurality of nodes, the configuration register stores data structure information of each node, and each of the link serials The content of the node is obtained based on the data structure information.
TW107123751A 2018-07-09 2018-07-09 Apparatus and method for searching linked lists TWI727185B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW107123751A TWI727185B (en) 2018-07-09 2018-07-09 Apparatus and method for searching linked lists
CN201811194779.XA CN110704330B (en) 2018-07-09 2018-10-15 Data access control device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107123751A TWI727185B (en) 2018-07-09 2018-07-09 Apparatus and method for searching linked lists

Publications (2)

Publication Number Publication Date
TW202006565A true TW202006565A (en) 2020-02-01
TWI727185B TWI727185B (en) 2021-05-11

Family

ID=69192604

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107123751A TWI727185B (en) 2018-07-09 2018-07-09 Apparatus and method for searching linked lists

Country Status (2)

Country Link
CN (1) CN110704330B (en)
TW (1) TWI727185B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116361346A (en) * 2023-06-02 2023-06-30 山东浪潮科学研究院有限公司 Data table parsing method, device, equipment and storage medium based on mask calculation

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448487B (en) * 2020-03-25 2024-06-21 慧荣科技股份有限公司 Computer-readable storage medium, method and device for writing flash memory management table
CN113495850B (en) * 2020-04-08 2024-02-09 慧荣科技股份有限公司 Method, apparatus and computer readable storage medium for managing garbage collection program
CN113641597B (en) * 2020-04-27 2024-07-12 慧荣科技股份有限公司 Method and apparatus for managing data storage and computer readable storage medium
CN115113799B (en) * 2021-03-18 2025-05-30 慧荣科技股份有限公司 Host command execution method and device
CN113742255B (en) * 2021-08-26 2023-08-08 合肥康芯威存储技术有限公司 Processing method and system for invalid marking command and data storage device
CN114327277B (en) * 2021-12-29 2025-01-14 深圳华电通讯有限公司 Garbage collection exception handling method, device, computer equipment and storage medium
CN115827501A (en) * 2022-12-06 2023-03-21 合肥大唐存储科技有限公司 A data storage management method and SSD
CN116383098B (en) * 2023-06-05 2023-09-12 成都佰维存储科技有限公司 Address indexing method and device, readable storage medium and electronic equipment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5924098A (en) * 1997-06-30 1999-07-13 Sun Microsystems, Inc. Method and apparatus for managing a linked-list data structure
US6067547A (en) * 1997-08-12 2000-05-23 Microsoft Corporation Hash table expansion and contraction for use with internal searching
KR100449708B1 (en) * 2001-11-16 2004-09-22 삼성전자주식회사 Flash memory management method
US9256527B2 (en) * 2010-07-27 2016-02-09 International Business Machines Corporation Logical to physical address mapping in storage systems comprising solid state memory devices
US8417914B2 (en) * 2011-01-06 2013-04-09 Micron Technology, Inc. Memory address translation
KR20140057454A (en) * 2012-11-02 2014-05-13 삼성전자주식회사 Non-volatile memory device and host device communicating with the same
KR101979735B1 (en) * 2012-11-02 2019-05-17 삼성전자 주식회사 Non-volatile memory system and host communicating with the same
US9405702B2 (en) * 2014-11-14 2016-08-02 Cavium, Inc. Caching TLB translations using a unified page table walker cache
US9942169B1 (en) * 2014-12-02 2018-04-10 Adtran, Inc. Systems and methods for efficiently searching for stored data
CN107291625B (en) * 2017-06-19 2020-06-09 济南浪潮高新科技投资发展有限公司 Pointer type logical address mapping table implementation method for Nand Flash

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116361346A (en) * 2023-06-02 2023-06-30 山东浪潮科学研究院有限公司 Data table parsing method, device, equipment and storage medium based on mask calculation
CN116361346B (en) * 2023-06-02 2023-08-08 山东浪潮科学研究院有限公司 Data table analysis method, device and equipment based on mask calculation and storage medium

Also Published As

Publication number Publication date
TWI727185B (en) 2021-05-11
CN110704330B (en) 2022-11-01
CN110704330A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
TWI727185B (en) Apparatus and method for searching linked lists
CN110765156A (en) Linked list searching device and method
TWI409695B (en) Systems, methods, and devices for configuring a device
CN106133721B (en) Parallel decision tree processor architecture
CN114860670B (en) File operation method of user space file system and user space file system
JP6004453B2 (en) Improved data access performance using deployment maps
CN111984324A (en) Stream address generation
WO2024124843A1 (en) Data processing method and apparatus, and device and readable storage medium
CN106156070A (en) A kind of querying method, Piece file mergence method and relevant apparatus
CN114637700B (en) Address translation method for target virtual address, processor and electronic equipment
CN108268596B (en) Method and system for searching data stored in memory
CN118796272A (en) A memory access method, processor, electronic device and readable storage medium
US11210280B2 (en) Systems and methods for fast bloom filter operations
CN111176704B (en) Difference packet file generation method, interruption recovery method and related device
US8645404B2 (en) Memory pattern searching via displaced-read memory addressing
CN109992535A (en) A kind of storage controlling method, device and system
CN115826858B (en) A control method and system for embedded storage chip
WO2017107835A1 (en) Browser starting method and apparatus
WO2023093023A1 (en) Sensitive word filtering method and apparatus, and storage medium
US10853123B2 (en) Memory module
WO2023028833A1 (en) Data processing method and apparatus, device, program, and medium
CN114356912A (en) Method for writing data into database and computer equipment
CN117393046B (en) A spatial transcriptome sequencing method, system, medium and equipment
WO2017215030A1 (en) Storage device having search function, and search method thereof
CN119557237B (en) SIMT architecture acceleration card debugging method, equipment and medium