Sourdis_Bispo_Nfa Documentation

This page contains the Sourdis_Bispo_Nfa Package documentation.

The sourdis_bispo_nfa Module

class netbench.pattern_match.algorithms.sourdis_bispo_nfa.sourdis_bispo_nfa.pcre_block_data(symbol, index, m, n=None)

Class containing informations about PCRE repetitions.

Parameters:
  • symbol (b_Symbol) – Repeated symbol.
  • index (int) – Index of PCRE repetition.
  • m (int) – Minimal number of repetitions.
  • n (int) – Maximal number of repetitions.
get_block_index_re()

Return regular expression for finding the ###index### patterns.

Returns:Regular expression for finding the ###index### patterns.
Return type:string
class netbench.pattern_match.algorithms.sourdis_bispo_nfa.sourdis_bispo_nfa.sourdis_bispo_nfa

Bases: netbench.pattern_match.nfa_reductions.nfa_reductions

NFA Pattern Matching algorithm as described in: Sourdis et al. Regular Expression Matching in Reconfigurable Hardware.

compute()
Compute Sourdis_Bispo automata mapping into FPGA.
create_string_and_pcre_symbols(create_strings=True, create_pcre=True)

Reduces automaton by usage of string and PCRE constraioned repetitions symbols.

Parameters:
  • create_strings (boolean) – If True string symbols are created, otherwise they are not created.
  • create_pcre (boolean) – If True PCRE constrained repetitions symbols are created, otherwise they are not created. NOTE: if create_pcre = False then find_pcre_repetitions() mathod cannot be used.
find_pcre_repetitions(FileName)

Discover .{n} like patterns and extracts them from regular expression. Found patterns are replaced by $$$index$$$ so they can be easily found in automaton and be replaced by special symbol.

Parameter:FileName (string) – Name of ruleset.
Returns:Preprocessed rules as string.
Return type:string
get_HDL()

Return HDL description of NFA unit implemented by Sourdis et al. approach.

Returns:HDL description of NFA unit implemented by Sourdis et al. approach.
Return type:string
get_all_string_subpatterns()

Traverse automaton and return dict of all string subpatterns. Dict key is the string and the value is its alphabet id.

Returns:Dict of all string subpatterns.
Return type:dict(string->int)
report_logic()

Reports amount of logic consumed by the algorithm.

Returns:Amount of logic consumed by the algorithm. (LUTs, FlipFlops, BRAMs)
Return type:tuple(int, int, int)

The test_sourdis_bispo_nfa Module

netbench.pattern_match.algorithms.sourdis_bispo_nfa.test_sourdis_bispo_nfa.create_simulation(alg)

Creates simulation files from templates for object specified by alg parameter.

Parameter:alg (b_ptrn_match) – Object representing pattern matching algorithm.
netbench.pattern_match.algorithms.sourdis_bispo_nfa.test_sourdis_bispo_nfa.load_file(name)

Open file specified by name and split content acording to “%$%”.

Parameter:name (string) – Name of the file.
Returns:Loaded and splited content of the file.
Return type:list(string)
netbench.pattern_match.algorithms.sourdis_bispo_nfa.test_sourdis_bispo_nfa.run_simulation(test)

Runs the simulation and compare the results.

Parameter:test – Object representing the test.
Returns:True when simulation is OK, False otherwise.
Return type:boolean
netbench.pattern_match.algorithms.sourdis_bispo_nfa.test_sourdis_bispo_nfa.save_file(name, content)

Save the content stored in parameter content into file named by parameter name.

Parameters:
  • name (string) – Name of the file.
  • content (string) – Content to write.
class netbench.pattern_match.algorithms.sourdis_bispo_nfa.test_sourdis_bispo_nfa.test_sourdis_bispo_nfa(methodName='runTest')

Bases: unittest.TestCase

A base test class for Sordis-Bispo NFA.

test_sb()
Tests the Sordis-Bispo algorithm.

Table Of Contents

Previous topic

Sindhu_Prasana_Nfa Documentation

Next topic

Delay_Dfa Documentation

This Page