-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfd3ae8
commit 00f8b8e
Showing
27 changed files
with
541 additions
and
721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ func newInt32ALU() *int32ALU { | |
} | ||
|
||
func (a *int32ALU) Execute(inst nvidia.Instruction) { | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package gpc | ||
|
||
import ( | ||
"github.com/sarchlab/mgpusim/v3/accelsim_tracing/nvidia" | ||
"github.com/sarchlab/mgpusim/v3/accelsim_tracing/sm" | ||
) | ||
|
||
type GPC struct { | ||
sms []*sm.SM | ||
} | ||
|
||
func (g *GPC) IsFree() bool { | ||
return true | ||
} | ||
|
||
func (g *GPC) Execute(tb *nvidia.ThreadBlock) { | ||
for _, sm := range g.sms { | ||
sm.Execute(tb) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package gpc | ||
|
||
import ( | ||
"github.com/sarchlab/mgpusim/v3/accelsim_tracing/sm" | ||
) | ||
|
||
type GPCBuilder struct { | ||
//gpc | ||
l2CacheSize int32 | ||
smCntPerGPC int32 | ||
|
||
//sm | ||
l1CacheSize int32 | ||
smDispatchStrategy string | ||
smUnitCntPerSM int32 | ||
|
||
//smunit | ||
l0CacheSize int32 | ||
registerFileSize int32 | ||
laneSize int32 | ||
aluInt32CntPerSMUnit int32 | ||
} | ||
|
||
func NewGPCBuilder() *GPCBuilder { | ||
return &GPCBuilder{ | ||
l2CacheSize: 0, | ||
smCntPerGPC: 0, | ||
l1CacheSize: 0, | ||
smDispatchStrategy: "", | ||
smUnitCntPerSM: 0, | ||
l0CacheSize: 0, | ||
registerFileSize: 0, | ||
laneSize: 0, | ||
aluInt32CntPerSMUnit: 0, | ||
} | ||
} | ||
|
||
func (g *GPCBuilder) WithSMCnt(cnt int32) *GPCBuilder { | ||
g.smCntPerGPC = cnt | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithSMUnitCnt(cnt int32) *GPCBuilder { | ||
g.smUnitCntPerSM = cnt | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithSMStrategy(strategy string) *GPCBuilder { | ||
g.smDispatchStrategy = strategy | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithL2CacheSizeConfig(size int32) *GPCBuilder { | ||
g.l2CacheSize = size | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithL1CacheSizeConfig(size int32) *GPCBuilder { | ||
g.l1CacheSize = size | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithL0CacheConfig(size int32) *GPCBuilder { | ||
g.l0CacheSize = size | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithRegisterFileConfig(registerFileSize int32, laneSize int32) *GPCBuilder { | ||
g.registerFileSize = registerFileSize | ||
g.laneSize = laneSize | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) WithALUConfig(aluType string, cnt int32) *GPCBuilder { | ||
switch aluType { | ||
case "int32": | ||
g.aluInt32CntPerSMUnit = cnt | ||
default: | ||
panic("ALU type is not supported") | ||
} | ||
return g | ||
} | ||
|
||
func (g *GPCBuilder) Build() *GPC { | ||
gpc := new(GPC) | ||
gpc.sms = make([]*sm.SM, g.smCntPerGPC) | ||
for i := range gpc.sms { | ||
gpc.sms[i] = sm.NewSMBuilder(). | ||
WithSMUnitCnt(g.smUnitCntPerSM). | ||
WithSMStrategy(g.smDispatchStrategy). | ||
WithL1CacheConfig(g.l1CacheSize). | ||
WithL0CacheConfig(g.l0CacheSize). | ||
WithRegisterFileConfig(g.registerFileSize, g.laneSize). | ||
WithALUConfig("int32", g.aluInt32CntPerSMUnit). | ||
Build() | ||
} | ||
return gpc | ||
} |
Oops, something went wrong.