<commit_before>from migen.fhdl.std import *
from migen.bank.description import *

def binify(s, size):
    assert size % 8 == 0
    blen = int(size / 8)
    assert len(s) <= blen
    s = s+'\0'*(blen-len(s))
    return sum(ord(c) << i * 8 for i, c in enumerate(s))


class PlatformInfo(Module, AutoCSR):
    def __init__(self, platform, target):
        self.platform = CSRStatus(64)
        self.target = CSRStatus(64)

        self.comb += [
            self.platform.status.eq(binify(platform, 64)),
            self.target.status.eq(binify(target, 64)),
        ]<commit_msg>gateware: Reverse the string.<commit_after>from migen.fhdl.std import *
from migen.bank.description import *

def binify(s, size):
    assert size % 8 == 0
    blen = int(size / 8)
    assert len(s) <= blen
    s = s+'\0'*(blen-len(s))
    return sum(ord(c) << i * 8 for i, c in enumerate(reversed(s)))


class PlatformInfo(Module, AutoCSR):
    def __init__(self, platform, target):
        self.platform = CSRStatus(64)
        self.target = CSRStatus(64)

        self.comb += [
            self.platform.status.eq(binify(platform, 64)),
            self.target.status.eq(binify(target, 64)),
        ]
{'fraction_non_alphanumeric': 0.14695945945945946, 'fraction_numerical': 0.02195945945945946, 'mean_word_length': 2.646153846153846, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5737715', 'n_tokens_mistral': 435, 'n_tokens_neox': 403, 'n_words': 95}