<commit_before>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os

from hwt.serializer.systemC.serializer import SystemCSerializer
from hwt.serializer.verilog.serializer import VerilogSerializer
from hwt.serializer.vhdl.serializer import VhdlSerializer
from hwt.simulator.simTestCase import SimTestCase
from hwt.synthesizer.utils import toRtl

from hwtLib.examples.hierarchy.groupOfBlockrams import GroupOfBlockrams
from hwtLib.examples.hierarchy.netFilter import NetFilter
from hwtLib.tests.statementTrees import StatementTreesTC


def readContent(file_name:str):
    THIS_DIR = os.path.dirname(os.path.realpath(__file__))
    with open(os.path.join(THIS_DIR, file_name)) as f:
        return f.read()


class HierarchySerializationTC(SimTestCase):

    def test_NetFilter_vhdl(self):
        u = NetFilter()
        s = toRtl(u, serializer=VhdlSerializer)
        netFilter_vhdl = readContent("netFilter.vhd")<commit_msg>codestyle<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os

from hwt.serializer.systemC.serializer import SystemCSerializer
from hwt.serializer.verilog.serializer import VerilogSerializer
from hwt.serializer.vhdl.serializer import VhdlSerializer
from hwt.simulator.simTestCase import SimTestCase
from hwt.synthesizer.utils import toRtl

from hwtLib.examples.hierarchy.groupOfBlockrams import GroupOfBlockrams
from hwtLib.examples.hierarchy.netFilter import NetFilter
from hwtLib.tests.statementTrees import StatementTreesTC


def readContent(file_name: str):
    THIS_DIR = os.path.dirname(os.path.realpath(__file__))
    with open(os.path.join(THIS_DIR, file_name)) as f:
        return f.read()


class HierarchySerializationTC(SimTestCase):

    def test_NetFilter_vhdl(self):
        u = NetFilter()
        s = toRtl(u, serializer=VhdlSerializer)
        netFilter_vhdl = readContent("netFilter.vhd")
{'fraction_non_alphanumeric': 0.08840970350404313, 'fraction_numerical': 0.00215633423180593, 'mean_word_length': 4.987096774193549, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4329480', 'n_tokens_mistral': 618, 'n_tokens_neox': 595, 'n_words': 120}