From eccb26874edc04dfdeb2e1c980547dc21dc71dd7 Mon Sep 17 00:00:00 2001 From: Mateusz Karlic Date: Fri, 21 Oct 2022 14:36:59 +0200 Subject: [PATCH] json2renode: cpu: Extract minor common logic --- litex/tools/litex_json2renode.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/litex/tools/litex_json2renode.py b/litex/tools/litex_json2renode.py index e7aaaddea..034edc59a 100755 --- a/litex/tools/litex_json2renode.py +++ b/litex/tools/litex_json2renode.py @@ -241,10 +241,6 @@ CPU.VexRiscv @ sysbus cpu_string += """ cpuType: "rv32im" """ - if time_provider: - cpu_string += """ - timeProvider: {} -""".format(time_provider) elif kind == 'picorv32': cpu_string = """ @@ -271,10 +267,6 @@ CPU.CV32E40P @ sysbus cpu_string += """ cpuType: "rv32imc" """ - if time_provider: - cpu_string += """ - timeProvider: {} -""".format(time_provider) else: raise Exception('Unsupported cpu type: {}'.format(kind)) @@ -285,6 +277,8 @@ CPU.CV32E40P @ sysbus cpu{cpu_id}: {cpu_string.strip()} hartId: {cpu_id} """ + if time_provider: + result += f' timeProvider: {time_provider}\n' return result