clint

package
v0.0.0-...-1aba0a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2025 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Overview

Package clint implements a driver for SiFive Core-Local Interruptor (CLINT) block adopting the following reference specifications:

  • FU540C00RM - SiFive FU540-C000 Manual - v1p4 2021/03/25

This package is only meant to be used with `GOOS=tamago GOARCH=riscv64` as supported by the TamaGo framework for bare metal Go on RISC-V SoCs, see https://github.com/usbarmory/tamago.

Index

Constants

View Source
const (
	MTIME = 0xbff8
)

CLINT registers

Variables

This section is empty.

Functions

This section is empty.

Types

type CLINT

type CLINT struct {
	// Base register
	Base uint64
	// CPU real time clock
	RTCCLK uint64
	// Timer offset in nanoseconds
	TimerOffset int64
}

CLINT represents a Core-Local Interruptor (CLINT) instance.

func (*CLINT) Mtime

func (hw *CLINT) Mtime() uint64

Mtime returns the number of cycles counted from the RTCCLK input.

func (*CLINT) Nanotime

func (hw *CLINT) Nanotime() int64

Nanotime returns the number of nanoseconds counted from the RTCCLK input plus the timer offset.

func (*CLINT) SetTimer

func (hw *CLINT) SetTimer(t int64)

SetTimer sets the timer to the argument nanoseconds value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL