Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 310e6e7

Browse files
committedFeb 26, 2015
gensoc: get platform_id from platform
1 parent 554731a commit 310e6e7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed
 

Diff for: ‎misoclib/gensoc/__init__.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from operator import itemgetter
3-
from collections import defaultdict
43
from math import ceil
54

65
from migen.fhdl.std import *
@@ -26,12 +25,6 @@ class GenSoC(Module):
2625
"uart": 0,
2726
"timer0": 1,
2827
}
29-
known_platform_id = defaultdict(lambda: 0x554E, {
30-
"mixxeo": 0x4D58,
31-
"m1": 0x4D31,
32-
"papilio_pro": 0x5050,
33-
"kc705": 0x4B37
34-
})
3528

3629
def __init__(self, platform, clk_freq, cpu_reset_address, sram_size=4096, l2_size=0, with_uart=True, cpu_type="lm32",
3730
csr_data_width=8, csr_address_width=14):
@@ -69,7 +62,9 @@ def __init__(self, platform, clk_freq, cpu_reset_address, sram_size=4096, l2_siz
6962
# CSR
7063
if with_uart:
7164
self.submodules.uart = uart.UART(platform.request("serial"), clk_freq, baud=115200)
72-
self.submodules.identifier = identifier.Identifier(self.known_platform_id[platform.name], int(clk_freq),
65+
platform_id = 0x554E if not hasattr(platform, "identifier") else platform.identifier
66+
print("%04x" %platform_id)
67+
self.submodules.identifier = identifier.Identifier(platform_id, int(clk_freq),
7368
log2_int(l2_size) if l2_size else 0)
7469
self.submodules.timer0 = timer.Timer()
7570

0 commit comments

Comments
 (0)
Please sign in to comment.